Spring Roo is a Java development tool and not a framework. Because of the name of the application, most of the people consider it as a framework. But in reality Spring Roo is a Java code creation tool. The java development tool does not demand for any library during runtime, it does not require any architectural style or coding. This is the reason why “Spring Roo” cannot be considered as a framework. Even it cannot be compared with other popular frameworks like play or Ruby on rails.
It is possible for the Java developers to create spring based web applications, graphic apps and many more using Java application tool. Let us try to understand its working how it speeds up the development process. It is easy to install Spring Roo java development application. You just have to download it and decompress the folder and you are done with the installation. When STS package was not included inside the application, it was operated through console. But with STS package, you can work directly. You just have to create a new Spring Roo project and save it. Now you can perform different tasks using application for making a wonderful Java project.
There are plenty of files and it is not easy to understand their coding structure. You just have to know about the basic files which are necessary to continue. At the same time, make the changes carefully for avoiding any interruption in near future.
Spring Roo Architecture
Till now, Spring Roo was using Patterns of Enterprise Application Architecture (PEAA).With the help of active record patterns, one line of DB can communicate with the object and DB operation is also held by the same object. The Main objective of active record patterns is to make the development task easier. It is possible to make the request with simple calls; this is the reason why development process is easier. After sometime it was recognized that testing is not easy using Spring Roo architecture because of implementation of static methods inside. As a result, transaction can be ambiguous. Recently its improved version has been released to remove this drawback. You can easily download this new version from web. Now we will learn how to configure JPA and how to add an entity.
It is easy for Java developers in India to configure JPA as you don’t have to change any command manually. First of all, it brings dependencies for hibernate, secondly it modifies the applicationContext.xml content and finally initializes the persistence.xml file. Just imagine how much time you have to waste if all these files need to be set manually.
For this purpose, you can use class type entity that is normally used in Java. Just add the following code to create an entity.
entity –class ~.domain.Book –activeRecord false
In the same way, field can be added. For example –
field string –fieldName name –class whiteship.domain.Book
At the end, implement the service and run the web application successfully. In this way, it is not difficult to work with Spring Roo Java application, if you are familiar with its basic structure. All the best for your new Spring Roo application.