Skip to main content

One Day in your Life... with UML2, oAW, Weblogic FastSwap, Oracle Enterprise Pack for Eclipse, Maven2 and SpringFramework...

In my new project - as usual in a software project - we have a very tight schedule. Using our old JEE application architecture (Oracle 10g, EJB 2.x, JFormular, Ant with Maven2 dependencies, full deployment EAR, WAR and EJB JAR on Weblogic 10.3 with Java6) would mean that we will have a long turn-around time (code, compile, deploy and test) for our development. Our build process with Ant does not support "naked" deployment", so it takes ages before the artefacts are built, jarred and can be deployed in Weblogic. In case that you only change one small thing in your web layer (JSP file, Java class) you will need to go through all those build steps. In combination that at that time I had an old development hardware (3 years old) you can imagine how horrible the situation was...

So I was searching for a better solution. We need a fast turn around time, especially in our web layer because I'm not an expert in JFormular and I definitely need to "try and error". At that moment I already know how easy to develop with GWT in hosted mode. You are just doing "ctrl-s" in Eclipse and make a reload on your browser. That's it, you will see all the changes directly. So your turn around process is just code, compile and test. No deployment anymore. You are very productive in this style. Amazing!

Luckily I found Oracle Enterprise Pack for Eclipse (OEPE) in combination with Weblogic FastSwap technology. With these stuffs you can do the GWT development style for JSP and any other web frameworks within your Eclipse as well. Not for all the things but it works very well. So after I found this I was thinking of making a new application architecture for our new project and here is the result:

1. Modeling strategies and technologies: UML2 (MagicDraw 16) with oAW generators. Actually I'm a fan of AndroMDA (yeah AndroMDA is a great Open Source project!), but because of certain circumstances we move to oAW (it was not my decision). From the application developer point of view I just need to generate the codes from the UML2 models. Nothing special here. In the mean time MagicDraw is becoming a very solid UML product. One thing which still needs some improvements is the file format (XMI) management. Since MagicDraw does not save the UML file in the native Eclipse UML file format you always need to export the file before it can get processed by oAW or AndroMDA. The export can take time if you have a big UML file.

I have to admit that my vision of "the next step in software development is reusing model components" is still not there. Four years after I wrote my MDA book I still don't see any movement that we are beginning to reuse models. But still it would be very cool if I need to have a user management component I can just import an UML2 user management module in my UML2 application module, afterwards I can customize the model und regenerate everything. At the end I can get a running application with a complete user management which is customized
for my application. Very cool but not a reality yet.

2. Implementation technologies: Oracle10g database, Weblogic 10.3, Hibernate 3.x.x, SpringFramework 2.x.x, JFormular (our own development for web framework):

I'm using OracleXE for development which is very good. Only for the integration test we use Oracle10g.

Weblogic 10.3 is a very solid software. There are some new things which I like in comparison with the older 8.1. Here are some points:
  • Support for FastSwap: This is great. In combination with OEPE (see below) you just make ctrl-s and reload on your browser and you will see the changes directly. Amazing, especially for development of web user interfaces. You also won't lose your session in the web application. So if you have an application in which you have to log in, you don't need to log in everytime you change something in your web application because your session is still there. There are some contrains in FastSwap but all in all you can life very good with FastSwap.
  • User interface of Weblogic 10.3 is a lot more better than the older version. Still you have a bug if you are using Chrome.
  • You can start Weblogic in a very slim version (without EJB, etc.), thanks to OSGi architecture of Weblogic. This is great if you just want to make a simple development with servlet.
3. Project structure and build process: Maven2. Actually I'm not fond of Maven2 because I always thought "I need my freedom and flexibility". I don't want to be dictated by a common structure and standard phases like in Maven. My project has always something specials so I need my own Ant task to get the flexiblity I need. I'm wrong, very wrong. After doing some stuffs in Maven2 I began to really like it. A very great build tool. I will never ever do my project without it again! Following points are the reason why I like Maven2:
  • The documentations of all those plugins are great. You can always find solutions to your problem in internet (I already forget how to do programming without internet ;-))
  • You have two great free Maven books which are very nice in case that you will need to understand something principally in Maven2 (Maven: The Definitive Guide and Better Builds with Maven). Something like Assembly or Profile for example.
And why is Maven2 should be your choice (instead of pure Ant)? Here are some reasons:
  • You can still use Ant in Maven2, so you actually don't lose your flexibility!
  • I already see some hand-written Ant tasks. OK you can surely standardized them all but almost all of them are just re-written of Maven goals (compile, test, package, install, deploy). So mostly they are quite useless. Especially in a small team of developers this is not applicable since one person needs to take care and always extend the build files. Did you ever try to extend Ant tasks which are not written by yourself? Have fun! Another thing is that in a lot of cases you will have to use the dependency management of Maven in Ant, so you are beginning using Ant task for Maven anyway. In this case just throw your Ant tasks away and start using Maven2. You can still integrate some of your Ant tasks directly in Maven2.
One thing I still don't like is the Maven2 Eclipse plugin. Yes this plugin is still buggy. After a long time of its existence it's a pitty that there is still no good Maven2 plugin for Eclipse. For more info - or problem - on Maven2 Eclipse plugin please continue reading.

Here is a list of topics which I found very useful during my first contact with Maven2:

4. IDE: Eclipse 3.4.x with OEPE and Maven2 plugins: OEPE offers you a lot of good functionalities (starting, stopping server, some editors for Weblogic stuffs, etc.). One I really like is the FastSwap technology. At the moment some developers are using a remote installation of Weblogic 10.3. It's a pitty that FastSwap only supported for a local installation of Weblogic. I don't know if FastSwap is working for a remote installation with a Samba access. Maybe worth to try.

In conjunction with Maven2 Eclipse plugin there are some bugs still available. If you are seperating your presentation layer (web war) and your business layer (jar) in two different Eclipse projects you can't have the FastSwap technique in your business layer. You also cannot use the Maven2 plugin functionality "Resolve Dependencies within Eclipse IDE" which is actually pretty cool. So you always need to "install" the business jar file into your local Maven repository. Your web application needs to link this jar file directly. See this discussion for this type
of bug: M2Plugin and OEPE. I hope to see bug fixes for all these problems, so that we can use FastSwap also in our business layer like with SpringFramework, etc.

I also found that this Eclipse plugin is a good one (not a perfect one) to see changes of your Weblogic or your application log files: Log Watcher.

All in all, with all its bugs, OEPE and Weblogic FastSwap are great technologies and if you are using Weblogic you have to try these stuffs. You will never ever want to comeback to your old development process and steps. One thing to remember: Using FastSwap does not mean that you don't need to write unit tests anymore! FastSwap is a beautiful technology to quickly prototype applications and unit tests are there for you to be able to deliver high quality applications. So the combination of both is just what you need!

One thing I want to replace in our application is JFormular web framework. Maybe it was a good framework in the past but today I won't develop a new application with that framework anymore. GWT would be a better choice for web user interface.

Update:

Have fun and be productive!
Lofi.

Comments

Unknown said…
Hi
I am looking to use OEPE for the same reasons as you. However I am surprised at the lack of documentation.
Any pointers as to kick starting OEPE when using Eclipse and maven. Also about migrating existing projects.
lofidewanto said…
Hi Steve,

Sofar I did not find any article or documentation about these stuffs...

I will try to write a small article about HOW-TO for OEPE, Maven2 and Eclipse... I'll put it here in my blog.

Cheers,
Lofi.
lofidewanto said…
Hi Steve,

I added the first HOW-TO for OEPE with Maven:
http://lofidewanto.blogspot.com/2009/11/how-to-oepe-with-maven2-and-m2eclipse.html

Cheers,
Lofi.

Popular posts from this blog

Software Development Macro and Micro Process

If you think that in year 2012 all companies which produce software and IT divisions in our world have already their optimized software development process, you are wrong. It seems that we - software architects, software developers or whatever your title is - still need to optimize the software development process in many software companies and IT divisions. So what do you do if you enter a software company or IT division and you see following things: 1. There is a perfect project management process to handle all those development of software but it is a pure project management without a context to software development. So basically you only take care of cost, time, budget and quality factors. In the software development you still use the old fashioned waterfall process. 2. From the tooling point of view: you have a project management planning and controlling tool but you are still in the beginning of Wiki (almost no collaboration tool) and you don't use issues tracking sy

Why "Polyglot Programming" or "Do It Yourself Programming Languages" or "Language Oriented Programming" sucks?

Last year we saw the launch of a new Web programming language Dart - Structured Web Programming from Google. A very interesting approach to support web application development. Not so long after Go, Groovy, Ruby, Scala, << name your DSL here >> ; we see Dart. Is it a good thing to have at least one programming language to solve one problem? The answer is, like we already know, it depends. Some important backgrounds you should know about the multi programming language paradigm are following: 1. You can read Martin Fowler article about language oriented programming with language workbenches which enables you to write small programming languages easily. In this article I see everyone writing their small languages, everywhere. In this concept we see DSL (Domain Specific Language) as the future of our programming activities. Source: http://martinfowler.com/articles/languageWorkbench.html 2. Neal Ford talked about Polyglot Programming, combining multiple programming language

Creating Spring Bean dynamically in the Runtime

In my training someone asked me whether it is possible to create an object (a Spring Bean) dynamically so you can choose which implementation you want to have  in the runtime . So at the compile time you don't know what object actually should be created yet. The application should decide what object to be created based on a property file . 1. We create an annotation so we can mark the method which should be able to create the object dynamically: ... package your.package; ... @Retention(RetentionPolicy.RUNTIME) public @interface InjectDynamicObject { } ... 2. Use the new created annotation in your method which should be able to create the object dynamically: ... @Named("customerBo") public class CustomerBoImpl implements CustomerBo { ...     @Override   @InjectDynamicObject   public Customer getDynamicCustomer() {         return this.dynamicCustomer; } ... 3. Write an aspect with Pointcut and Advise which change the ob