Spring Roo
Developer(s) | SpringSource |
---|---|
Stable release | 1.0.1 / 2010-1-29 |
Written in | Java |
Operating system | Cross-platform |
Platform | Java Virtual Machine |
Development status | Active |
Type | Software development |
License | GNU General Public License 3.0 |
Website | http://www.springsource.org/roo |
Spring Roo is an open source software tool that uses convention-over-configuration principles to provide rapid application development of Java-based enterprise software. The resulting applications use common Java technologies such as Spring Framework, Java Persistence API, Java Server Pages, Apache Maven and AspectJ.[1] Spring Roo is a member of the Spring portfolio of projects.
Motivation and History
Spring Roo's stated mission statement is to "fundamentally and sustainably improve Java developer productivity without compromising engineering integrity or flexibility". [2]
The technology was first demonstrated during the opening keynote at the SpringOne Europe developer conference on 27 April 2009, with an initial alpha release concurrently being published. During the keynote an application was built live on-stage that would be used by conference attendees to vote on the preferred name for the project (which at that time was codenamed "Roo" within SpringSource). [3] Ultimately the name "Spring Roo" was preferred over alternatives including Spring Boost, Spring Spark, Spring HyperDrive and Spring Dart. [4]
Several releases followed,[5] with the Roo 1.0.0.GA (general availability) released in December 2009. [6] The current Roo project engineers are employed by SpringSource (a division of VMware) and as such Roo releases typically support the latest available releases of other Spring portfolio projects.
Standards and Technology Compatibility
Roo's default installation facilitate the creation of applications that comply with the following standards and major technologies: [7]
- Apache ActiveMQ (as an embedded JMS implementation)
- Apache Maven (version 2.0.9 or above)
- Apache OpenJPA (as a JPA implementation)
- Apache Tiles (default MVC views)
- Apache Tomcat (hosted execution support)
- AspectJ (used for AOP plus mixins to achieve separation of concerns)
- AspectJ Development Tools (Eclipse plugin)
- Cloud computing (via [SpringSource Cloud Foundry])
- Dojo Toolkit (via Spring JavaScript)
- Eclipse IDE (concurrent execution and project metadata creation)
- EclipseLink (as a JPA implementation)
- Java Bean Validation (JSR 303) (including Hibernate Validator)
- Java Database Connectivity (for JPA usage)
- Java Message Service (both message producers and consumers)
- Java Persistence API (multiple implementations)
- Java Transaction API (via Spring transaction abstraction)
- Java (version 5 or above)
- Java Server Pages (default MVC views)
- Jetty (hosted execution support)
- JUnit (automated tests for user projects)
- Log4J (installation and configuration)
- OSGi (all Roo projects use OSGi-compliant dependencies, plus Roo offers manifest management commands)
- Selenium (automated tests for user projects)
- Spring Framework (version 3 or above)
- Spring Security (version 3 or above)
- Spring Web Flow (installation and flow definition)
- URL Rewrite Filter (for REST URIs)
- Web application resource (WAR file) (for deployment packaging)
The above list can be augmented through additional Roo add-ons, which provide Roo's method of extensibility.
Implementation
User Interface
Spring Roo's main user interface is a command-line shell. The shell provides both a command-line interface and also a mechanism to host plug-ins (which are called "add-ons" in Roo). One key design goals of Roo is to ensure a user can continue to work in a "natural way", which typically means using their preferred integrated development environment (IDE) or text editor for most tasks. As such Roo is often loaded in a separate window to the IDE or text editor, and will monitor the file system for changes made by the user outside of Roo. A startup-time scan of a user's project is also performed to determine any changes that may have been made while Roo was not running.
The user interface shell supports extensive usability features including command line completion (ie press TAB), online help, hinting (a form of context-sensitive help) and contextual awareness (which provides automatic inference of likely intentions based on recent activity). This allows a user to create a new software project via the Roo shell, or use Roo on an existing project. The following is an example of the commands used by Roo to create a new project and turn it into a WAR file:
Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.
roo> project --topLevelPackage com.helloworld
Created /home/guest/hello/pom.xml
Created SRC_MAIN_JAVA
Created SRC_MAIN_RESOURCES
Created SRC_TEST_JAVA
Created SRC_TEST_RESOURCES
Created SRC_MAIN_WEBAPP
Created SRC_MAIN_RESOURCES/META-INF/spring
Created SRC_MAIN_RESOURCES/META-INF/spring/applicationContext.xml
roo> persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
Created SRC_MAIN_RESOURCES/META-INF/persistence.xml
Created SRC_MAIN_RESOURCES/META-INF/spring/database.properties
Managed SRC_MAIN_RESOURCES/META-INF/spring/applicationContext.xml
Managed ROOT/pom.xml
roo> perform package
Created ROOT/target/helloworld-1.0.0.war
The above commands did not need to be typed in full, but rather were completed using TAB. Additionally, the "hint" command could have been used to acquire help at any time.
Base Add-Ons
There are numerous commands available in Roo, depending on which "base add-ons" (those which ship with Roo) and "third-party add-ons" (those that do not ship with Roo) have been installed. The base add-ons shipping with Roo 1.0.0 include:
- Backup: enables backups to be made to a ZIP file by typing
backup
- Bean Info: exposes JavaBean property, accessor and mutator metadata (primarily used by other add-ons)
- Bundlor: provides an OSGi manifest management mechanism
- Configurable: introduces Spring Framework's @Configurable annotation (primarily used by other add-ons)
- Data on Demand: provides seed data that is compliant with JSR 303 (JavaBean Validation) annotations present in entities
- Email: simplifies setup of SMTP-based emails and mail sender support via Javamail
- Entity: extensive support for automatically maintaining Java Persistence API @Entity classes
- Dynamic Finder: creates typesafe, code-completion compatible JPA query language finders
- Java Bean: automatically maintains JavaBean getters/setters for classes with an @RooJavaBean annotation
- JMS: simplifies connecting to a JMS provider (or embedding ActiveMQ) and sending/receiving JMS messages
- JPA: installs a specified JPA provider and sets up JDBC accordingly
- Logging: sets up Log4j, including command-based log level configuration
- Maven: enables use of Apache Maven as the build system for the user's project
- Pluralization: provides pluralization of nouns (primarily used by other add-ons)
- Property Editor: manages property editors, as required by Spring MVC
- Property File: manages Java properties files and provides shell commands to read, set and remove property values
- Security: sets up Spring Security, including login pages, filters and dependencies
- Integration Test: produces JUnit integration tests for project entities
- ToString: produces a valid toString() method for any class with the @RooToString annotation
- Web (various): maintains Spring MVC controllers and JSP files
Roo Core Modules
Roo also includes a core set of modules that provide a hosted execution environment for different add-ons. These major modules include:
- Support: used by core modules and add-ons for common utility class support services
- Metadata: provides a metadata service provider interface and implementation that includes dependency registration and caching
- File monitor: publishes events following detected file system changes (the default implementation uses auto-scaled disk polling)
- File undo: provides a file undo facility for use by the process manager
- Project: abstracts typical end user project build systems like Apache Maven and Apache Ant
- Process manager: offers an ACID-like file system abstraction that includes disk rollback and process synchronization
- Classpath: performs abstract syntax tree parsing and type binding of Java and AspectJ compilation units
Internally Roo operates by automatically generating AspectJ inter-type declarations (otherwise known as mixins or introductions). This achieves separation of concerns, as the code maintained by Roo is in a different compilation unit from the code a user writes. This means Roo can incrementally modify the AspectJ inter-type declarations that it needs to and leave all other files intact. [8]
Differentiation
Spring Roo differentiates from other convention-over-configuration rapid application development tools in the following major ways: [9]
- Java platform productivity: Roo provides a productivity solution for Java developers. It does not require the user to program in any language other than Java. It also uses mainstream Java enterprise application standards and technologies (as listed above) to maximize reuse of existing developer knowledge, skills and experience.
- Usability: Roo's shell is designed to provide a discoverable, easy-to-use environment that minimizes training requirements. Roo annotations all start with @Roo to facilitate code assist (command line completion in IDEs). Users can use their IDE for all operations and do not need to be aware of Roo running. Roo also supports users editing their files when Roo is not running.
- No runtime: Roo does not provide a runtime API or require specific runtime components. This ensures there is no Roo-related CPU, memory and disk storage resource consumption at runtime. Roo code is optimized for small-footprint cloud deployment and high scalability use cases.
- Avoids lock-in: Roo can be rapidly removed from a user project, which is useful to protect against vendor lock-in. This is possible because there is no runtime component to remove, @Roo annotations are "source retention" only (ensuring they are not preserved in compiled *.class files)[10] and Roo's AspectJ inter-type declarations can be "pushed in" to standard *.java compilation units. [11]
- Extensibility: Roo's separation of core infrastructure and base add-ons ensures third parties can easily extend Roo. [12]
References
- ↑ "Spring Roo home page"; Retrieved 2009-10-17.
- ↑ "Jump into Roo for extreme Java productivity"; Retrieved 2009-10-17.
- ↑ "The Future of Java Innovation"; Retrieved 2009-10-17.
- ↑ "Getting Started with Spring Roo"; Retrieved 2009-10-17.
- ↑ "Spring Roo download history"; Retrieved 2009-10-17.
- ↑ "Forum reply by project lead"; Retrieved 2009-10-17.
- ↑ "Spring Roo home page"; Retrieved 2009-10-17.
- ↑ "Exploring Roo's Architecture"; Retrieved 2009-10-17.
- ↑ "Exploring Roo's Architecture"; Retrieved 2009-10-17.
- ↑ "Java 5 JavaDocs for RetentionPolicy.SOURCE"; Retrieved 2009-10-17.
- ↑ "Push-In Refactoring for AJDT"; Retrieved 2009-10-17.
- ↑ "Spring Roo: technical deep dive"; Retrieved 2009-10-17.
External links
- Spring Roo Home Page
- Spring Roo Support Forum
- Spring Roo Download Site
- Twitter hash code #roo search
- Spring Roo Resources
- Introduction to Spring Roo presentation by Spring Roo project lead Ben Alex, from SpringOne Europe 2009
Other Articles
- InfoWorld: SpringSource CEO to tout Roo, a new Java Enhancement Published 1 June 2009
- InfoQ: Spring Roo 1.0 M1 Released Published 31 May 2009
If you like SEOmastering Site, you can support it by - BTC: bc1qppjcl3c2cyjazy6lepmrv3fh6ke9mxs7zpfky0 , TRC20 and more...