Andrej Koelewijn

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.

2 Responses to “OptimalJ - part 1”

  1. Nevin Ng Says:

    Regarding the code customization, OptimalJ provides you the concept of “Guarded Block” & “Free Block”. After OJ generates the implementation code by employing the best practice’s patterns, each code/script it generates will contain a combination of these two blocks.

    As reflected by the name, a Guarded Block is the block of code that vital for the execution of the generated J2EE application, which contains frameworks, organization’s standards, guidelines and supporting concerns, etc. So within the source code editor these blocks are in blue background and you’re not allowed to edit.

    On the other hand, Free Block is an area of code in which developers can add or modify the generated Java code. Free blocks are provided to give developers the ability to extend or customize OptimalJ’s generated applications. Free Block are preserved amongst code regeneration so all the modification are re-inserted (merged) into the same Free Block between code generation.

    Hope this clarify.

  2. Erwin Says:

    I saw a presentation today given by a sales person of compuware and it disapointed me a lot! The filosophy of MDA is to create an application based on abstract models, and not to create a j2ee application. In my point of view:
    1 optimalJ is just another tool to create a way too heavy j2ee app
    2 MDA is not ment for this

Leave a Reply

Powered by WordPress