Wednesday, November 08, 2006

[Event] Second day on W-JAX

Today was the second day of the main conference at the W-JAX.

As a Spring fan I was forced to attend the sessions about Architecture with Spring and Spring and AspectJ. Eberhard presented why Spring is a unique technology, because it concentrates on simple objects and enclose these simple objects with:
  • Dependency Injection to compose applications
  • AOP to manage Cross Cutting Concerns (Security, Logging, Transaction)
  • Portable Service Abstraction in order to provide an easy access to available technologies (Hibernate, JDBC,..)
He also illustrated Best Practices of Spring and how architectures can be built by using Spring. A typical Spring application is based on the layered architecture:
  • Service objects/Business Facade
  • Data Access Layer, seperated in a DAO interface and DAO implementation layer
Why is Spring a good choice in the Data Access Layer?
  • The test of the DAO layer becomes easier, by using Mock objects
  • More technologies can be used, like Hibernate, JPA, iBATIS or JDBC
  • Spring provides a consistent Exception hierarchy
He also responsived to the advantages of Spring in the Service layer, like declarative transaction management by using AOP. Beside the above advantages, he illustrated how to organize the layers in the code. Therefore he pointed to the following approaches:
  • Configure each layer in an isolated configuration file and import these configurations to the application context
  • Create an application context for each layer (dao, service, gui)
  • OSGi
  • Packaging and Spring 2.0 AOP pointcuts
  • @Repository annotation
A very interesting technology is AspectJ, where you can define rules for the code. For example it is possible to say, that a DAO implementation can not use a class of the service layer. These rules are defined through aspects. In my opinion these two sessions where convincing to use Spring as base technology and framework in future projects.

At present there is a lot ruble around Ruby on Rails. But what is the problem? It is not Java. Therefore the Java community awake the Grails project providing the possibility to develop web applications in a fast way. The session Grails - Rapid Web Application Development gives me the chance to get a first impression about Grails. And it rocks! Grails is a classical MVC framework based on the following key components:
  • Groovy
  • Spring (IoC, Spring MVC, Spring Web Flow)
  • Hibernate (Persistence)
  • Site Mesh (Layout Framework
  • Quartz
An application is build by using groovy commands with parameters, like application name, domain objects and the like. With this metadata, Grails can produce a sekeletal structure of the application. The speaker went through the MVC pattern in Grails, by explaining how the Model, View and Controller in Grails are implemented. An interesting thing in Grails, is that the produced skeleton already provides CRUD functionality. I believe that this framework could become a serious technology in near future, because the following key features are provides:
  • Auto Reloading (agile development)
  • Spring integration
  • Hibernate integration
  • AJAX support by integrate some toolkits, like DOJO.
The last session I attented this day concentrates on Architecturemanagement, where the speaker illustrates actual problems of complex software projects. The predefined software architecture often changes during the development. In order to ensure a stable software architecture during the software development process it is necessary to define some metrics that helps to identify architecture failures. Beside the metrics he illustrated the steps to make a logical architecture:
  1. Define horizontal layers (Data, Business, Presentation)
  2. Define vertical slices, illustrate the business
  3. Define rules
With this logical architecture the subsystems can be identified. He also mentioned that Spring is in his opinion the best framework to structure an application.

1 comment:

Anonymous said...

Hi Markus,

This is Ayyappan Selvaraj.
A nice article on the framework..
I require few documents on Best Practices for implementing Spring and Hibernate in applictaion..
Help please