Posts

Showing posts from April, 2015

Use of @Configurable annotation.

Not, all types(beans) used in a Spring Based Application are Spring managed. Sometimes, we need to inject some dependency into some Types which are not Spring Managed. The most common example being, injection of Service or DAO layer within the Entity class. Now the instances of Entity classes are being created using the new operator, i.e. they are not Spring Managed. Now we want to inject the corresponding Service or DAO Type which is Spring Managed within these Entity Types, and these can be performed with the help of @Configurable . It is the Aspects, which performs all the underlying engineering and ,makes this thing possible. Let's see an example. @Configurable public class Person { @Autowired ResourceBundleThemeSource themeSource; private String firstName; private String lastName; private int age; private Address address; @CustomDateFormat Date birthDate; MultipartFile profile; public String getFirstName() { return firstName; } public voi

Spring Roo!!!!! But a Different Demeanour

When I had my first interaction with Spring Roo , I was trying to figure the features that makes it an absolute pleasure to use. After traversing through the code that it generates, I found the following interesting features and I believe that there is more to be explored of it. 1) InterType Declarations with Aspects. 2) Use of @Configurable annotation. 3) Use of JSP's in XML format i.e. (.jspx) 4) Use of Spring Theme and Localization. 5) Use of Apache Tiles 3 in Views. First, of all I will start with @Configurable annotation. I am going to discuss my experience with each of the above mentioned features separately. I have tried to use them separately in a Spring based Application.