Monday, November 28, 2011

Spring Roo 1.1 Cookbook review by Cengiz Öner

I just came across review of Spring Roo 1.1 Cookbook by . Many thanks to Cengiz for writing the review :)

You can visit Cengiz's blog and read the complete review here : http://gwtsts.blogspot.com/2011/11/review-spring-roo-11-cookbook-by-ashish.html

Monday, October 31, 2011

Tuesday, October 18, 2011

Spring Roo presentation

Last week I gave a presentation on Spring Roo in Silicon India conference held in Hyderabad. I tried my best to give a complete example that makes use of Spring Roo features to develop a Flight Booking application. Link to PDF: http://www.siliconindia.com/events/siliconindia_events/Java_Hyd_Conf/Ashish_Spring_Roo.pdf

Wednesday, October 5, 2011

Quick introduction to AspectJ ITD

In this post, I'll show a few examples of AspectJ ITDs that are generated by Spring Roo and the declarations contained in those ITDs. You'll find a more detailed discussion in Chapter 1 (which is available for download) of Spring Roo 1.1 Cookbook.

Example 1: FlightService_Roo_ToString.aj
package sample.roo.flightapp.service;

privileged aspect FlightService_Roo_ToString {
   
    public String FlightService.toString() {
        StringBuilder sb = new StringBuilder();
       sb.append("Origin: ")
         .append(getOrigin());
        return sb.toString();
    }
} 

The following figure shows what the above declaration implies:


Example 2FlightService_Roo_Serializable.aj

package sample.roo.flightapp.service;

import java.io.Serializable;

privileged aspect FlightService_Roo_Serializable {
   
  declare parents: FlightService implements Serializable;
   
  private static final long FlightService.serialVersionUID
      = 5059552858884348572L
}


The following figure shows what the above declaration implies:


Tuesday, October 4, 2011

Spring Roo 1.1 Cookbook promotion at Javaranch

This week I'll be responding to questions related to Spring Roo in the Spring forum of Javaranch (http://www.coderanch.com/forums/f-96/Spring). You can win a copy of the book by posting questions in the Spring forum.

Spring Roo - future of Java application development

Traditional Java enterprise application development required developers to write the boilerplate code. The Spring Framework simplified Java enterprise application development with DI and POJO-based approach to developing applications. No wonder, Spring Framework has become the most popular platform for developing applications.

Spring Framework simplifies developing enterprise applications using standard technologies, like JPA, Hibernate, JDBC, Flex, JavaMail, JMS, and so on. Still, you need to write some generic configuration and generic code which can be generated by a tool. Let's look at a few examples:

1. If you write a class, you normally override the toString method
2. If you write a JPA entity class, then you provide getter/setters methods for persistent fields, method to obtain reference to EntityManager, create persistence.xml, and so on.
3. When using Spring Web MVC, you need to configure handler mappings, create controller classes corresponding to JPA entities, create JSP views, and so on.
...

And the list goes on and on, depending upon the technology or framework that you are using. If all these generic configurations and code are generated and managed by a development tool, developers will be more productive. And, if the code generated follows best practices of development, then you don't need to even worry about incorporating best practices in your application architecture. This is where Spring Roo comes as the next generation productivity improvement tool.

Spring Roo generates generic configurations and code to help developers focus on writing the business logic. There are no runtime dependencies of application on Spring Roo, and you can easily modify the Roo-generated code by using Push-in refactoring. So, even though you are using a productivity improvement tool, you have full control over modifying the generated code, and you don't need to learn any new language or frameworks to do so. If you know Spring, you can easily get started with using Spring Roo effectively. Spring Roo truely defines the future of enterprise Java application development.

Thursday, September 29, 2011

How to get the most out of Spring Roo 1.1 Cookbook

The recipes covered in Spring Roo 1.1 Cookbook are applicable to version 1.1.3, 1.1.4 and 1.1.5 version of Spring Roo. The Spring Roo 1.2 is currently in the milestone release, and it's final release will come sometime in December or early next year. Here, a few of my recommendations when going through recipes in Spring Roo 1.1 Cookbook:

1 - Use Spring Roo 1.1.5 when working with recipes described in Spring Roo 1.1 Cookbook. 
2 - Don't do copy-paste of commands from eBook to Roo shell. Instead, type it yourself on the Roo shell (you don't need to type everything because Roo offers auto-completion feature)
3 - If you are evaluating Spring Roo for developing an application which makes use of a set of technologies or frameworks, then pay close attention to 'How it works...' section, which describes what all configuration and code is generated by Spring Roo.
4 - If you are using Spring Roo to learn a technology, it is important to focus on 'How it works...' section.
5 - Be prepared to write code or customize the Roo-generated code. A lot of recipes show what to customize and how to customize Roo-generated code.