Andrej Koelewijn

7/29/2003

TPL - OptimalJ’s templating language

Filed under: — andrejk @ 9:56 pm

As i mentioned yesterday, one of the issues people have with MDA is, how easy it is to modify generated code, and if these changes are maintained when regenerating code from the models.

The code editor in OptimalJ clearly shows you which parts you can modify (white background) and which parts you can’t touch as showed in this screenshot.
optimalj_code_free_block.png Whenever you regenerate the code, the added parts in the free blocks will be untouched.

Optimalj has it’s own templating language TPL. Within the template you can specify which parts are guarded, i.e., generated from the models, and which parts are free code, and should be restored after a regeneration. Free parts have an id so they can be identified when regenerating the code. The resulting code looks like this:

    /**
     * Converts IssueUpdateObject into a IssueDataObject.
     */
    public IssueDataObject(IssueUpdateObject updateObject) { 
        this.setId(updateObject.getId());
        this.setSummary(updateObject.getSummary());
        this.setPriority(updateObject.getPriority());
        this.setIssueType(updateObject.getIssueType());
        this.setDateCreated(updateObject.getDateCreated());
        this.setDescription(updateObject.getDescription());
//GEN-FREE-GEN:toDataObject$$DATAOBJECT$pidf6aef9ffd57bc7d // your code here

//GEN-GUARD:1$$DATAOBJECT$pidf6aef9ffd57bc7d

}

OptimalJ - some screenshots

Filed under: — andrejk @ 1:00 am

Here are some screenshots of OptimalJ.

The first image shows the Domain model, containing two conceptual classes, Sales order and Order line. It also show their attributes. These classes are created using wizard. For this simple example no services are included.
Domain Model

The second image shows the Domain Class Diagram. Here you can draw associations between classes, define the multiplicity of the association, and specify the type of the association, for example composite aggregation.
Class Diagram

The next picture shows the application model explorer. I’ve created three application models based on the Domain model created previously. The three application models are: ejb model, database model and web model. These models are generated in three steps.
Application Model

Now the code model can be generated, the result of this is displayed in the next picture, which shows the code model explorer. This requires one action, and all code will be generated. The code is put into 2 different directories, one for the model and services, and one for the web code.
Code Model

Finally, i’ve added a picture of some generated code in this last picture. This picture shows part of the jsp generated for browsing Order lines. As you can see it contains pretty straightforward html using the struts tags.
Jsp code

7/28/2003

OptimalJ - part 1

Filed under: — andrejk @ 10:33 pm

I picked up a demo version of optimalj professional editional from the post office last thursday, and installed it yesterday. When i talked to one of the compuware representatives they said i needed to mail them to get a key for the evaluation, but optimalj seems to work for 30 days without installing a key, which is nice.

I started by following the ‘your first optimalj application’ tutorial in the documentation. The default help window is a modal window, which you can’t minimize and which is closed automatically when you press finish in one of the wizard. Weird, and irritating. Then i discovered that the documentation is also provided as a pdf, which works a lot nicer, as i can now alt tab between the documentation and optimalj.

The basic process in optimalj is as follows:
1) You define your application, independently of the technology it will use. You do this in the domain model. The domain model contains classes and services.
2) Now you can generate the implementation models, for example, an ejb model, an database (ER) model, and a web model (which can be 3 tier using ejb’s, or 2 tier using DOA’s)
3) Finally you can generate the code model based on the implementation models.

Once you have the code you can compile and deploy.

I saw some blog entries (e.g., MDA rant) which question the use of MDA. The biggest problem seems to be that code generators will not easily be able to merge generated code with hand written code. I don’t know yet how optimalj solves this problem, but in Oracle Designer you just enter the code that needs to be added to the generated code in Oracle Designer itself. Then, upon generating the code, Oracle Designer will mix the entered code with the generated code.

Oracle Designer does not eliminate the need to write code, but the code that needs to be written is a lot less and a lot easier than the code that the developer would have need to write when doing everything manual. And the developer doesn’t have to think about the application framework, or the architecture. Just the domain model (conceptual entities) and business rules (written using a normal programming language, pl/sql) and the rest is generated. And this work for at least 90% of all data entry applications. I don’t see why this wouldn’t work for most java/j2ee applications. Most j2ee applications i have worked on so far have been data entry applications, and most of that code could have been generated.

7/22/2003

Improving productivity using MDA

Filed under: — andrejk @ 1:40 pm

Some intersting reads on theserverside and the register about improving productivity using MDA with OptimalJ.

I don’t have any experience yet with optimalj, but my evaluation kit is waiting for me in the post-office. I’m quite curious to see how i’ll like it.

I noticed some scepticism when reading the thread on the serverside, but i’m sure that MDA will improve productivity, especially for standard problems. In the company i work for, it-eye, we use Oracle Designer a lot for generating back-office data entry applications, reports, database pl/sql code and database schema’s. Designer is quite good at this, and most application can be generated for 100%. You see that a lot of our customers aim for this, as it makes upgrading to newer versions of Oracle Forms, Oracle Reports, and the Oracle RDBMS easier. The more i read about MDA, the more it looks like Oracle Designer, but vendor and platform neutral, based on an open standard.

The problem with Oracle Designer, one customer mentioned, is that it requires a lot of knowledge of the user. He actually wittnessed one developer trying a lot of properties, which took a full day, before the correct application was generated. Using Oracle Developer (oracle’s 4gl gui application tool), this would have taken 10 minutes. Sometimes Designer gets kind of fuzzy and it is not very clear which property to change to change something in the generated application.

So don’t think that you need less knowledgeable developers on your project just because the code is generated. But MDA tools can improve the productivity of skilled developers when creating certain kinds of applications.

7/15/2003

Javacertificate.com

Filed under: — andrejk @ 12:12 am

Just found this site:
Javacertificate.com. Seems like a workable way to quickly learn for SCJP. Anybody have experience with this? Is it possible to pass the exam just by studying this site?

What to expect in linux 2.6

Filed under: — andrejk @ 12:08 am

Here are some usefull links which summarize most of the changes in 2.6: The Wonderful World of Linux 2.6, and The post-halloween document. v0.42.

7/8/2003

Oracle ADF (Application Development Framework)

Filed under: — andrejk @ 6:36 pm

Oracle’s Application Development Framework (ADF) is what makes the upcoming JDeveloper 9.0.5 exciting. ADF enables you to easily combine all the good technologies that exist right now (JSP, UIX, BC4J, Toplink, EJB, Struts). Amazingly it will not force you to use oracle technologies, but it will allow you to configure what you want to use. For example, you can use Struts as the controller, or you can use Oracle ADF controller. For the view layer you can choose JSP’s, UIX, or even Swing. All this uses the ADF binding and ADF Data Control API’s, which oracle wants to standardize (See JSR 227).

And it looks like JDeveloper will make this all really easy, just some dragging and dropping and changing properties. It’s almost like using Oracle Forms. Makes you wonder though, who ever wanted to change the technologies used inside Forms? I can see how you may want to specify what kind of interface to generate (html or gui), but do you really care if underneath it uses bc4j or toplink? As longs as it works.

All in all it looks like Oracle is delivering with JDeveloper what Sun has promissed with Rave. Let’s see how well Sun delivers. And jdeveloper seems to become as productive as visual studio. Good marketing Oracle, now let me try it!

(More on this subject here)

Dive into BC4J

Filed under: — andrejk @ 9:39 am

If you’re interested in oracle, java, jdeveloper and bc4j, you may find Steve Muench’s blog interesting to read.

On the subject of jdeveloper, this viewlet shows some of the new features in the upcomming version 9.0.5 of jdeveloper. It’ll enable you to create j2ee applications by drag and drop and property clicking.

7/2/2003

Presentations from ONEday available online

Filed under: — andrejk @ 3:46 pm

The presenatation from the ONEday seminar are online

Powered by WordPress