Last week I attended TheServerSide Java Symposium Europe, a 3 day conference held in Barcelona. I was pleasantly surprised by the variety of topics, the quality of the speakers and the professional organization; it reminded me of the early days of JavaOne.
J2EE vs Spring/Hibernate open source stacks
One of the recurrent themes of the conference was that EJB had been a mistake, and that Spring and other technologies had grown up to solve developer problems that J2EE had plainly failed to address. The opinion of many speakers was that EJB3 and JPA were ok, but maybe too late to be widely adopted. The power of Spring AOP, dependency injection and IoC combined with the fact that Spring is a toolbox, allowing you to pick and choose what you use, were felt by many to be the reasons that Spring/Hibernate projects had succeeded where J2EE had often failed. This was good news to us as we are heavy supporters of Spring.
In this vein I attended a talk on the architecture of the new Guardian Unlimited website, the Guardian being a quality British newspaper. The new site has been developed on an 100% open-source stack, using Velocity as a replacement for JSP and their previous content management system, and Spring and Hibernate in the business and data tiers. In order to achieve the performance required for the enormous number of visitors to the site, they made heavy use of front end caching techniques and relied on the fact that the most frequently accessed pages where less than a week old. Another interesting fact about the implementation was that they had used Agile methodologies from the start. To ensure that communication occurred on the project they used pair-programming and moved new developers around from area to area so that each developer quickly obtained a knowledge of the workings of the whole system. I was pleased to hear this from others as we firmly believe in this way of working.
Pattern Driven Development
On the last day of TSSJS I went to two very interesting talks, one from Adrian Coyler, the CTO of Interface 21 on “Simplifying Enterprise Application Development with AOP” and another one by Ben Alex, also from Interface 21 entitled “A Fast Hop into Real Object Oriented (ROO) Apps: Tech Case Study of a Real-World ROO App” and another one. In the latter talk Ben, who is the managing director for the Interface21 Australia and Asia-Pacific regions, showed us a Domain Driven Development (DDD) framework called ROO that they had developed to reduce the tedious boiler-plate coding of the patterns found time and time again in good web-based development. In ROO, you define your Domain Model, and then the framework, based on maven archetypes, does the rest, generating code for the MVC, Data Transfer Objects, the Business Layer Façade and the DAO layers. ROO even generates the stubs for your integration tests for you; all you have to do is actually fill in the code that tests the semantics of your business operations. I am not going to go into the details of ROO here, if you want more information I suggest you look at Matt Raible’s entry on ROO in his blog . I will say I found it very exciting as we have created similar frameworks in our clients, but none have had the level of code-generation that Ben’s framework had. It solves a problem we see time and time again where the developers misunderstand the architectural patterns or just don’t use any design patterns. Ben said that they were in internal discussions on whether to Open Source it and when. They also have plans to add support for Java5 annotations and to drop support for Java 1.4.
In the first talk, Adrian Colyer outlined some new paradigms that you can use first with Spring AOP, then when you get the hang of AOP, combining Spring AOP with full AOP using AspectJ. We are big fans of AOP and use it whenever we can. One of the paradigms that I found really powerful was using AOP to identify idempotent methods that could fail because of e.g. thread-deadlock. Adrian added a pointcut to retry the methods N-times in the case of failure. It struck me that this was far more powerful than the proxy approach to do the same thing. It occurred to me that I can apply it to some situations I have where RMI calls fail and a re-connect to the server is needed.
The second paradigm that I found incredibly interesting was using the AspectJ DSL to specify domain pattern rules that should be checked at compile time. Using the eclipse plugin, Adrian showed us an example where he defined a compile time Aspect warning that should appear if JDBC calls were made outside the context of Spring. This technique can be used whenever you have large projects and there are developers with less experience, highlighting using compile-time warnings that they are violating the established architectural patterns. I can’t wait to try it out on a real project!
While I was listening to the second talk on ROO, I had a sort of epiphany (don’t laugh) that combining Adrian’s AOP with the ROO enforcement of robust web-tier patterns would enable Pattern Driven Development to become a reality. Wouldn’t it be fantastic if you got a warning that you were using the DAO without going through the business Façade?
These technologies, combined with the productivity tools now available in modern IDEs such as Eclipse and NetBeans, promise a very bright future for modern Web Software Development.
Part 2 to come.
on Sep 4th, 2007 at 2:52 pm
Compile-time checks with AspectJ…
While reading a post on The Server Labs Blog the other day, this paragraph immediately caught my attention : using the AspectJ DSL to specify domain pattern rules that should be checked at compile time [...]…
on Sep 10th, 2008 at 12:14 pm
[...] has been a while since we first heard about compile-time checks with AspectJ at the Java Server Symposium in 2007. Since then we have been using and experimenting with this feature of AOP and AspectJ, and more [...]