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:
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.
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.
- 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.
- 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.
Here is a list of topics which I found very useful during my first contact with Maven2:
- Introductory article at JavaWorld: An Introduction to Maven 2
- Maven2 with Weblogic 10.3: Integration
- SpringFramework, Hibernate, Maven2, EasyMock, etc.: Gridshore: Open Source Software Development by Example
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:
- I'm beginning to write some HOW-TOs and project examples for working with Eclipse, Maven2, M2Eclipse, OEPE, WLS 10.3 and FastSwap.
- Here is a short introductory HOW-TO: OEPE - FastSwap with Maven2 and M2Eclipse Plugin.
Have fun and be productive!
Lofi.
Comments
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.
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.
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.