Spring Roo: Difference between revisions
Rescuing 1 sources and tagging 0 as dead.) #IABot (v2.0.9.5) (Whoop whoop pull up - 21816 |
|||
(75 intermediate revisions by 51 users not shown) | |||
Line 1: | Line 1: | ||
{{short description|Open-source software tool}} |
|||
{{Infobox software |
{{Infobox software |
||
| name = Spring Roo |
| name = Spring Roo |
||
| logo = |
| logo = Logo SpringRoo.png |
||
| screenshot = |
| screenshot = Spring-Roo-Shell.png |
||
| caption = Spring Roo |
| caption = Spring Roo 2.0.x |
||
| developer = [[ |
| developer = DISID, [[Pivotal Software]] |
||
| latest release version = 1.3.2 |
|||
| status = Active |
|||
| latest release |
| latest release date = {{Start date|2015|09|01}} |
||
| latest |
| latest preview version = 2.0.0.RELEASE |
||
| latest preview |
| latest preview date = {{Start date|2019|09|30}} |
||
| latest preview date = |
|||
| operating system = [[Cross-platform]] |
|||
| platform = [[Java Virtual Machine]] |
|||
| programming language = [[Java (programming language)|Java]] |
| programming language = [[Java (programming language)|Java]] |
||
| |
| platform = [[Java SE]] |
||
| |
| genre = [[Rapid application development]] |
||
| |
| license = [[Apache License 2.0]] |
||
| website = {{URL|https://projects.spring.io/spring-roo/}} |
|||
}} |
}} |
||
'''Spring Roo''' is an [[Open-source software|open-source]] software tool that uses [[convention over configuration|convention-over-configuration]] principles to provide [[rapid application development]] of [[Java (programming language)|Java]]-based [[enterprise software]].<ref>[http://www.infoworld.com/t/development-frameworks/springsource-ceo-tout-roo-new-java-enhancement-215 "InfoWorld: SpringSource CEO to tout Roo, a new Java enhancement"] by Paul Krill; Dated 2009-06-01.</ref> The resulting applications use common Java technologies such as [[Spring Framework]], [[Java Persistence API]], [[Thymeleaf]], [[Apache Maven]] and [[AspectJ]].<ref>[http://www.sdtimes.com/link/33843 "SD Times: Roo released to handle repetitive Spring tasks"] {{Webarchive|url=https://web.archive.org/web/20120225180322/http://www.sdtimes.com/link/33843 |date=2012-02-25 }} by Alex Handy; Dated 2009-10-19.</ref> Spring Roo is a member of the [[Spring Framework|Spring]] portfolio of projects. |
|||
== Motivation and history == |
|||
'''Spring Roo''' is an [[open source]] software tool that uses [[convention over configuration|convention-over-configuration]] principles to provide [[rapid application development]] of [[Java (programming language)|Java]]-based [[enterprise software]]<ref>[http://www.infoworld.com/t/development-frameworks/springsource-ceo-tout-roo-new-java-enhancement-215 "InfoWorld: SpringSource CEO to tout Roo, a new Java enhancement"] by Paul Krill; Dated 2009-06-01.</ref>. The resulting applications use common Java technologies such as [[Spring Framework]], [[Java Persistence API]], [[JavaServer Pages|Java Server Pages]], [[Apache Maven]] and [[AspectJ]]<ref>[http://www.sdtimes.com/link/33843 "SD Times: Roo released to handle repetitive Spring tasks"] by Alex Handy; Dated 2009-10-19.</ref>. Spring Roo is a member of the [[Spring Framework|Spring]] portfolio of projects. |
|||
Spring Roo's mission statement is to ''"fundamentally improve Java developer productivity without compromising engineering integrity or flexibility"''.<ref>[http://static.springsource.org/spring-roo/reference/html/background.html#background-mission "Spring Roo reference documentation"], Mission Statement section; Retrieved 2010-2-21.</ref> |
|||
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]]).<ref>[http://www.bestechvideos.com/2009/06/11/springone-europe-2009-keynote-the-future-of-java-innovation "Tech Videos: The Future of Java Innovation"] {{webarchive|url=https://web.archive.org/web/20091009064424/http://www.bestechvideos.com/2009/06/11/springone-europe-2009-keynote-the-future-of-java-innovation |date=2009-10-09 }} by Rod Johnson (CEO of SpringSource); Retrieved 2009-10-17.</ref> Ultimately the name "Spring Roo" was preferred over alternatives including Spring Boost, Spring Spark, Spring HyperDrive and Spring Dart.<ref>[http://static.springsource.org/spring-roo/reference/html/background.html#background-history "Spring Roo reference documentation"], History section; Retrieved 2010-2-21.</ref> |
|||
==Motivation and History== |
|||
Several releases followed,<ref>[http://www.infoq.com/news/2009/05/spring-roo-1.0-m1-release "InfoQ: Spring Roo 1.0 M1 Released"] by Srini Penchikala; Dated 2009-5-31.</ref><ref>[https://jira.springsource.org/browse/ROO#selectedTab=com.atlassian.jira.plugin.system.project%3Aversions-panel "Jira issue tracking for Spring Roo Project releases"]; Retrieved 2010-2-21.</ref> with the Roo 1.0.0.RELEASE ([[development stage|general availability]]) released in December 2009. In October 2010, Spring Roo 1.1.0.RELEASE was released. The 1.1.0 release moved to an OSGi foundation with associated add-on discovery model, plus added support for incremental database reverse engineering, Spring MVC page complexity reduction, Google Web Toolkit, Google App Engine, Apache Solr, JSON and smaller features like serializable automation.<ref>[http://blog.springsource.com/2010/10/27/spring-roo-1-1-0-is-released/ "A Big Hop Forward: Spring Roo 1.1.0 Is Released!"] {{webarchive|url=https://web.archive.org/web/20101028205359/http://blog.springsource.com/2010/10/27/spring-roo-1-1-0-is-released/ |date=2010-10-28 }}, by Ben Alex (lead of Spring Roo at SpringSource); Retrieved 2010-10-27.</ref> The current Roo project engineers are employed by SpringSource and as such Roo releases typically support the latest available releases of other [[Spring Framework|Spring]] portfolio projects. |
|||
Spring Roo's stated mission statement is to ''"fundamentally and sustainably improve Java developer productivity without compromising engineering integrity or flexibility"''<ref>[http://static.springsource.org/spring-roo/reference/html/background.html#background-mission "Spring Roo reference documentation"], Mission Statement section; Retrieved 2010-2-21.</ref>. |
|||
In 2014 [http://www.disid.com/ DISID] takes over the leadership of the open source framework Spring Roo after the partnership agreement with Pivotal. |
|||
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]]).<ref>[http://www.bestechvideos.com/2009/06/11/springone-europe-2009-keynote-the-future-of-java-innovation "Tech Videos: The Future of Java Innovation"] by Rod Johnson (CEO of SpringSource); Retrieved 2009-10-17.</ref> Ultimately the name "Spring Roo" was preferred over alternatives including Spring Boost, Spring Spark, Spring HyperDrive and Spring Dart.<ref>[http://static.springsource.org/spring-roo/reference/html/background.html#background-history "Spring Roo reference documentation"], History section; Retrieved 2010-2-21.</ref> |
|||
They collaborate on further development of the Spring Roo project. Roo will continue in its goal of providing a code-gen style of RAD framework. |
|||
The Spring Roo project will remain as an open source project under Spring, maintaining the same current licensing policy. Both Pivotal and DISID are calling on the Spring and Java communities for anyone who would like to collaborate in the project. |
|||
Several releases followed,<ref>[http://www.infoq.com/news/2009/05/spring-roo-1.0-m1-release "InfoQ: Spring Roo 1.0 M1 Released"] by Srini Penchikala; Dated 2009-5-31.</ref><ref>[https://jira.springsource.org/browse/ROO#selectedTab=com.atlassian.jira.plugin.system.project%3Aversions-panel "Jira issue tracking for Spring Roo Project releases"]; Retrieved 2010-2-21.</ref> with the Roo 1.0.0.RELEASE ([[development stage|general availability]]) released in December 2009<ref>[http://java.dzone.com/news/spring-roo-10-rad-tool-java "Spring Roo 1.0 - a RAD tool for Java"] by Mitchell Pronschinske; Dated 2010-1-4.</ref>. In October 2010, Spring Roo 1.1.0.RELEASE was released. The 1.1.0 release moved to an OSGi foundation with associated add-on discovery model, plus added support for incremental database reverse engineering, Spring MVC page complexity reduction, Google Web Toolkit, Google App Engine, Apache Solr, JSON and smaller features like serializable automation<ref>[http://blog.springsource.com/2010/10/27/spring-roo-1-1-0-is-released/ "A Big Hop Forward: Spring Roo 1.1.0 Is Released!"], by Ben Alex (lead of Spring Roo at SpringSource); Retrieved 2010-10-27.</ref>. The current Roo project engineers are employed by SpringSource and as such Roo releases typically support the latest available releases of other [[Spring Framework|Spring]] portfolio projects. |
|||
==Standards and |
== Standards and technology compatibility == |
||
Roo's default installation facilitates the creation of applications that comply with the following standards and major technologies:<ref>[http://chariottechcast.libsyn.org/index.php?post_id=551262 "TechCast: Spring Roo podcast"] {{Webarchive|url=https://web.archive.org/web/20100223065309/http://chariottechcast.libsyn.org/index.php?post_id=551262 |date=2010-02-23 }} by Ken Rimple; Retrieved 2010-2-21.</ref> |
|||
* [[Apache ActiveMQ]] (as an embedded [[Java Message Service|JMS]] implementation) |
|||
Roo's default installation facilitates the creation of applications that comply with the following standards and major technologies:<ref>[http://chariottechcast.libsyn.org/index.php?post_id=551262 "TechCast: Spring Roo podcast"] by Ken Rimple; Retrieved 2010-2-21.</ref> |
|||
* [[Apache Maven]] (version 3.2 or above) |
|||
* [[ |
* [[Apache Tomcat]] (embedded execution support) |
||
* [[Adobe Flex]] (via a [[SpringSource]]-provided plugin) |
|||
* [[Apache Maven]] (version 2.2 or above) |
|||
* [[Apache OpenJPA]] (as a [[Java Persistence API|JPA]] implementation) |
|||
* [[Apache Solr]] (search server) |
|||
* [http://tiles.apache.org/ Apache Tiles] (default [[Model–view–controller|MVC]] views) |
|||
* [[Apache Tomcat]] (hosted execution support) |
|||
* [[AspectJ]] (used for [[Aspect-oriented programming|AOP]] plus [[mixin]]s to achieve [[separation of concerns]]) |
* [[AspectJ]] (used for [[Aspect-oriented programming|AOP]] plus [[mixin]]s to achieve [[separation of concerns]]) |
||
* |
* AspectJ Development Tools (Eclipse plugin) |
||
* Bootstrap (version 3.3.6 or above) |
|||
* [[Cloud computing]] (via [http://www.cloudfoundry.com SpringSource Cloud Foundry], [[Google App Engine]] and [http://www.vmforce.com/ VMforce]) |
|||
* [[Cloud computing]] (via SpringSource Cloud Foundry, [[Google App Engine]] and VMforce) |
|||
* [[Dojo Toolkit]] (via Spring JavaScript) |
|||
* [[ |
* [[Eclipse IDE]] (concurrent execution and project metadata creation) |
||
* [[EclipseLink]] (as a [[Java Persistence API|JPA]] implementation) |
* [[EclipseLink]] (as a [[Java Persistence API|JPA]] implementation) |
||
* [[Google Web Toolkit]] (since GWT 2.1, including GWT 2.1 features like request factory) |
|||
* [[Hibernate (Java)|Hibernate]] (as a [[Java Persistence API|JPA]] implementation) |
* [[Hibernate (Java)|Hibernate]] (as a [[Java Persistence API|JPA]] implementation) |
||
* |
* Java Bean Validation (JSR 303) (including Hibernate Validator) |
||
* [[Java |
* [[Java API for XML Web Services]] (both services and clients) |
||
* [[Java Message Service]] (both message producers and consumers) |
* [[Java Message Service]] (both message producers and consumers) |
||
* [[Java Persistence API]] (multiple implementations) |
* [[Java Persistence API]] (multiple implementations) |
||
* [[Java Transaction API]] (via [[Spring Framework|Spring]] transaction abstraction) |
* [[Java Transaction API]] (via [[Spring Framework|Spring]] transaction abstraction) |
||
* [[Java (programming language)|Java]] (version 5 or |
* [[Java (programming language)|Java]] (version 5, 6 or 7). Java 7 is supported since Roo 1.2.4.<ref>[http://forum.spring.io/forum/spring-projects/roo/128539-spring-roo-1-2-4-release-available-now "Spring Roo 1.2.4.RELEASE available now "] Dated 2013-10-17.</ref> |
||
* [[JQuery]] (version 1.11 or above) |
|||
* [[JavaServer Pages|Java Server Pages]] (default [[Model–view–controller|MVC]] views) |
|||
* [[ |
* [[JSON]] (REST support) |
||
* [[JSON]] (methods in classes for serialization, deserialization and REST support) |
|||
* [[JUnit]] (automated tests for user projects) |
* [[JUnit]] (automated tests for user projects) |
||
* [[Log4J]] (installation and configuration) |
* [[Log4J]] (installation and configuration) |
||
* [[OSGi]] (the Roo tool is built on OSGi) |
* [[OSGi]] (the Roo tool is built on OSGi) |
||
* [[Representational State Transfer|Representational State Transfer (REST)]] |
* [[Representational State Transfer|Representational State Transfer (REST)]] |
||
* Spring Boot (version 1.4 or above) |
|||
* [[Selenium (Software)|Selenium]] (automated tests for user projects) |
|||
* |
* Spring Data JPA (version 1.10 or above) |
||
* [[Spring |
* [[Spring Framework]] (version 4 or above) |
||
* [[Spring Security]] (version 4 or above) |
|||
* [[Spring Web Flow]] (installation and flow definition) |
* [[Spring Web Flow]] (installation and flow definition) |
||
* |
* SpringSource Tool Suite (STS has an embedded Roo shell and Roo command helpers) |
||
* [[Thymeleaf]] (version 3 or above) |
|||
* [[WAR (Sun file format)|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]]. |
The above list can be augmented through additional Roo add-ons, which provide Roo's method of [[extensibility]]. |
||
== User interface == |
|||
==Implementation== |
|||
===User Interface=== |
|||
Spring Roo's main user interface is a command-line [[Shell (computing)|shell]]. The shell provides both a [[command-line interface]] and also a mechanism to host [[Plug-in (computing)|plug-ins]] (which are called "add-ons" in Roo). One key design goal 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. |
Spring Roo's main user interface is a command-line [[Shell (computing)|shell]]. The shell provides both a [[command-line interface]] and also a mechanism to host [[Plug-in (computing)|plug-ins]] (which are called "add-ons" in Roo). One key design goal 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 |
The user interface shell supports extensive [[usability]] features including [[command-line completion]] (i.e. 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 application plus the Spring Boot Maven plugin ''run'' goal to compile and run the application using an embedded HTTP server: |
||
<syntaxhighlight lang="bash"> |
|||
<code> |
|||
$ mkdir hello |
|||
Welcome to Spring Roo. For assistance press TAB or type "hint" then hit ENTER.<br /> |
|||
$ cd hello |
|||
roo> project --topLevelPackage com.helloworld<br /> |
|||
$ roo.sh |
|||
Created /home/guest/hello/pom.xml<br /> |
|||
roo> project setup --topLevelPackage com.foo |
|||
Created SRC_MAIN_JAVA<br /> |
|||
roo> jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY |
|||
Created SRC_MAIN_RESOURCES<br /> |
|||
roo> entity jpa --class ~.domain.Timer |
|||
Created SRC_TEST_JAVA<br /> |
|||
roo> field string --fieldName message --notNull |
|||
Created SRC_TEST_RESOURCES<br /> |
|||
roo> repository jpa --all |
|||
Created SRC_MAIN_WEBAPP<br /> |
|||
roo> service --all |
|||
Created SRC_MAIN_RESOURCES/META-INF/spring<br /> |
|||
roo> web mvc setup |
|||
Created SRC_MAIN_RESOURCES/META-INF/spring/applicationContext.xml<br /> |
|||
roo> web mvc view setup --type THYMELEAF |
|||
roo> persistence setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY<br /> |
|||
roo> web mvc controller --all --responseType THYMELEAF |
|||
Created SRC_MAIN_RESOURCES/META-INF/persistence.xml<br /> |
|||
roo> web mvc controller --all --pathPrefix /api |
|||
Created SRC_MAIN_RESOURCES/META-INF/spring/database.properties<br /> |
|||
roo> quit |
|||
Managed SRC_MAIN_RESOURCES/META-INF/spring/applicationContext.xml<br /> |
|||
$ mvn spring-boot:run |
|||
Managed ROOT/pom.xml<br /> |
|||
</syntaxhighlight> |
|||
roo> perform package<br /> |
|||
Created ROOT/target/helloworld-1.0.0.war<br /> |
|||
</code> |
|||
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. |
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. |
||
== Architecture == |
|||
While there are many ways that software can [[automatic programming|automatically generate]] code,<ref>[http://www.infoq.com/news/2009/09/codegen-java-development "InfoQ: Role of Code Generation in Java Development"] by Srini Penchikala; Dated 2009-9-3.</ref> Roo operates by generating [[AspectJ]] inter-type declarations (otherwise known as [[mixin]]s 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.<ref>[http://www.infoq.com/presentations/Introducing-Spring-Roo "InfoQ: Introduction to Spring Roo 1.0.0 Video Presentation"], by Ben Alex (lead of Spring Roo at SpringSource); Retrieved 2010-2-21.</ref><ref>[http://www.slideshare.net/desmax74/spring-roo-jaxitalia09 "JAX Italia 2009 Conference: Spring Roo"] by Massimiliano Dessì; Retrieved 2010-2-21.</ref><ref>[http://www.slideshare.net/krimple/philly-spring-ug-roo-overview "Philadelphia Java User Group: Spring Roo"] by Ken Rimple; Retrieved 2010-2-21.</ref> |
|||
Spring Roo uses add-ons to provide all the functionality within and on top of an [[OSGi]] runtime system based on [[Apache Felix]]. |
|||
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.1.0 include: |
|||
=== 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 2.0.x include: |
|||
* '''Add-On Creator''': enables easy creation of third-party Roo add-ons |
* '''Add-On Creator''': enables easy creation of third-party Roo add-ons |
||
Line 108: | Line 103: | ||
* '''Database reverse engineering''': allows incremental reverse engineering of relational databases |
* '''Database reverse engineering''': allows incremental reverse engineering of relational databases |
||
* '''Data on Demand''': provides seed data that is compliant with [[Bean Validation|JSR 303 (JavaBean Validation)]] annotations present in entities |
* '''Data on Demand''': provides seed data that is compliant with [[Bean Validation|JSR 303 (JavaBean Validation)]] annotations present in entities |
||
* '''DTO''': extensive support for automatically maintaining [[Data Transfer Object]]s |
|||
* '''Email''': simplifies setup of [[SMTP]]-based emails and mail sender support via [[Javamail]] |
* '''Email''': simplifies setup of [[SMTP]]-based emails and mail sender support via [[Javamail]] |
||
* '''Entity''': extensive support for automatically maintaining [[Java Persistence API]] @Entity classes |
* '''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 |
* '''Java Bean''': automatically maintains JavaBean getters/setters for classes with an @RooJavaBean annotation |
||
* '''JDBC''': encapsulates OSGi-compliant access to JDBC drivers shipped in different bundles (primarily used by other add-ons) |
* '''JDBC''': encapsulates OSGi-compliant access to JDBC drivers shipped in different bundles (primarily used by other add-ons) |
||
* '''JMS''': simplifies connecting to a [[Java Message Service|JMS]] provider (or embedding [[ActiveMQ]]) and sending/receiving JMS messages |
* '''JMS''': simplifies connecting to a [[Java Message Service|JMS]] provider (or embedding [[ActiveMQ]]) and sending/receiving JMS messages |
||
* '''JPA''': installs a specified [[Java Persistence API|JPA]] provider and sets up [[ |
* '''JPA''': installs a specified [[Java Persistence API|JPA]] provider and sets up [[JDBC]] accordingly |
||
* '''JSON''': adds [[JSON]] related serialization and deserialization methods to POJOs |
* '''JSON''': adds [[JSON]] related serialization and deserialization methods to POJOs |
||
* '''Logging''': sets up [[Log4j]], including command-based log level configuration |
* '''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) |
* '''Pluralization''': provides [[pluralization]] of nouns (primarily used by other add-ons) |
||
* '''Property Editor''': manages property editors, as required by [[Spring Framework|Spring]] [[Model–view–controller|MVC]] |
* '''Property Editor''': manages property editors, as required by [[Spring Framework|Spring]] [[Model–view–controller|MVC]] |
||
* '''Property File''': manages [[Java (programming language)|Java]] properties files and provides shell commands to read, set and remove property values |
* '''Property File''': manages [[Java (programming language)|Java]] properties files and provides shell commands to read, set and remove property values |
||
* '''RooBot Client''': simplifies discovery, searching, installation and security verification of third-party Roo add-ons |
|||
* '''Security''': sets up [[Spring Security]], including login pages, filters and dependencies |
* '''Security''': sets up [[Spring Security]], including login pages, filters and dependencies |
||
* '''Test''': produces [[JUnit]] integration tests for project classes |
|||
* '''Serializable''': adds java.io.Serializable support (such as UID maintenance) to requested Java types |
|||
* '''Solr''': integrates with [[Apache Solr]] by linking into the entity persistence lifecycle and introducing search-related methods to classes |
|||
* '''Integration Test''': produces [[JUnit]] integration tests for project entities |
|||
* '''ToString''': produces a valid toString() method for any class with the @RooToString annotation |
* '''ToString''': produces a valid toString() method for any class with the @RooToString annotation |
||
* '''Web Flow''': installs the [[Spring Web Flow]] and creates a default flow |
|||
* '''Web (various)''': maintains [[Spring Framework|Spring]] [[Model–view–controller|MVC]] controllers, Spring Web Flow and [[JavaServer Pages|JSP]] files<ref>[http://www.slideshare.net/schmidtstefan/spring-one2-gx-slides-stefan-schmidt "Extreme Web Productivity with Spring Roo"] by Stefan Schmidt (Spring Roo software engineer at SpringSource); Retrieved 2010-2-21.</ref> |
|||
* '''Web MVC''': maintains the view layer based on [[Spring Framework|Spring]] [[Model–view–controller|MVC]] plus [[Thymeleaf]] templates and the [[RESTful]] API |
|||
* '''WS''': produces SOAP services and SOAP clients |
|||
===Roo Core Modules=== |
|||
=== 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: |
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 |
* '''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 |
* '''Metadata''': provides a [[metadata]] service provider interface and implementation that includes dependency registration and caching |
||
Line 144: | Line 135: | ||
* '''URL Stream''': encapsulates access to downloads in different host environments (Roo shell, IDE embedding) and enforces the [[Pretty Good Privacy]]-based httppgp:// protocol handler |
* '''URL Stream''': encapsulates access to downloads in different host environments (Roo shell, IDE embedding) and enforces the [[Pretty Good Privacy]]-based httppgp:// protocol handler |
||
== Differentiation == |
|||
While there are many ways that software can [[automatic programming|automatically generate]] code<ref>[http://www.infoq.com/news/2009/09/codegen-java-development "InfoQ: Role of Code Generation in Java Development"] by Srini Penchikala; Dated 2009-9-3.</ref>, Roo operates by generating [[AspectJ]] inter-type declarations (otherwise known as [[mixin]]s 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.<ref>[http://www.infoq.com/presentations/Introducing-Spring-Roo "InfoQ: Introduction to Spring Roo 1.0.0 Video Presentation"], by Ben Alex (lead of Spring Roo at SpringSource); Retrieved 2010-2-21.</ref><ref>[http://www.slideshare.net/desmax74/spring-roo-jaxitalia09 "JAX Italia 2009 Conference: Spring Roo"] by Massimiliano Dessì; Retrieved 2010-2-21.</ref><ref>[http://www.slideshare.net/krimple/philly-spring-ug-roo-overview "Philadelphia Java User Group: Spring Roo"] by Ken Rimple; Retrieved 2010-2-21.</ref> |
|||
==Differentiation== |
|||
Spring Roo differentiates from other convention-over-configuration rapid application development tools in the following major ways:<ref>[http://www.springsource.org/roo "Spring Roo Home Page"]; Retrieved 2010-2-21.</ref> |
Spring Roo differentiates from other convention-over-configuration rapid application development tools in the following major ways:<ref>[http://www.springsource.org/roo "Spring Roo Home Page"]; Retrieved 2010-2-21.</ref> |
||
# '''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 (programming language)|Java]]. It also uses mainstream Java enterprise application standards and technologies (as listed above) to maximize reuse of existing developer knowledge, skills and experience. |
# '''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 (programming language)|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. |
# '''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 [[Run time (program lifecycle phase)|runtime]] API or require specific runtime components. This ensures there is no Roo-related [[ |
# '''No runtime''': Roo does not provide a [[Run time (program lifecycle phase)|runtime]] API or require specific runtime components. This ensures there is no Roo-related [[CPU]], [[Memory (computers)|memory]] and [[disk storage]] resource consumption at runtime. Roo code is optimized for small-footprint [[Cloud computing|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)<ref>[http://java.sun.com/j2se/1.5.0/docs/enwiki/api/java/lang/annotation/RetentionPolicy.html#SOURCE "Sun Java 5 JavaDocs for RetentionPolicy.SOURCE"] by Sun Microsystems; Retrieved 2009-10-17.</ref> and Roo's AspectJ [[mixins|inter-type declarations]] can be "pushed in" to standard *.java compilation units.<ref>[http://contraptionsforprogramming.blogspot.com/2009/05/push-in-refactoring-for-ajdt.html "Push-In Refactoring for AJDT"] by Andrew Eisenberg (AJDT project lead at SpringSource); Retrieved 2009-10-17.</ref><ref>[http://dhruba.name/2009/12/31/eclipse-ajdt-intertypes-and-push-in-refactoring/ "Eclipse AJDT intertypes and Push-In refactoring"] by Dhruba Bandopadhyay; Dated 2009-12-31.</ref> |
# '''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)<ref>[http://java.sun.com/j2se/1.5.0/docs/enwiki/api/java/lang/annotation/RetentionPolicy.html#SOURCE "Sun Java 5 JavaDocs for RetentionPolicy.SOURCE"] by Sun Microsystems; Retrieved 2009-10-17.</ref> and Roo's AspectJ [[mixins|inter-type declarations]] can be "pushed in" to standard *.java compilation units.<ref>[http://contraptionsforprogramming.blogspot.com/2009/05/push-in-refactoring-for-ajdt.html "Push-In Refactoring for AJDT"] by Andrew Eisenberg (AJDT project lead at SpringSource); Retrieved 2009-10-17.</ref><ref>[http://dhruba.name/2009/12/31/eclipse-ajdt-intertypes-and-push-in-refactoring/ "Eclipse AJDT intertypes and Push-In refactoring"] {{webarchive|url=https://web.archive.org/web/20100117122939/http://dhruba.name/2009/12/31/eclipse-ajdt-intertypes-and-push-in-refactoring/ |date=2010-01-17 }} by Dhruba Bandopadhyay; Dated 2009-12-31.</ref> |
||
# '''Extensibility''': Roo's separation of core infrastructure and base add-ons intends to allow third parties to easily extend Roo.<ref>[http://www.slideshare.net/desmax74/spring-roo-internals-javaday-iv "Italian Java User Group JavaDay IV Conference: Spring Roo Internals"] by Massimiliano Dessì; Retrieved 2010-2-21.</ref><ref>[http://ecmarchitect.com/archives/2009/12/16/1076 "Spring, Roo, and Alfresco Too: What Alfresco Gave to Spring and Why"] by Jeff Potts; Dated 2009-12-16.</ref> |
# '''Extensibility''': Roo's separation of core infrastructure and base add-ons intends to allow third parties to easily extend Roo.<ref>[http://www.slideshare.net/desmax74/spring-roo-internals-javaday-iv "Italian Java User Group JavaDay IV Conference: Spring Roo Internals"] by Massimiliano Dessì; Retrieved 2010-2-21.</ref><ref>[http://ecmarchitect.com/archives/2009/12/16/1076 "Spring, Roo, and Alfresco Too: What Alfresco Gave to Spring and Why"] by Jeff Potts; Dated 2009-12-16.</ref> |
||
==See also== |
== See also == |
||
{{Portal |
{{Portal|Free and open-source software|Computer programming}} |
||
* [[Grails (framework)]] |
|||
* [[Griffon (framework)]] – A Desktop framework inspired by Grails |
|||
* [[Play Framework]] |
|||
==References== |
== References == |
||
{{Reflist}} |
{{Reflist|30em}} |
||
==External links== |
== External links == |
||
*{{Official website}} |
|||
* [http://www.springsource.org/roo Spring Roo Home Page] |
|||
* [http://forum.springsource.org/forumdisplay.php?f=67 Spring Roo Support Forum] |
|||
* [http://www.springsource.com/download/community?project=Spring%20Roo Spring Roo Download Site] |
|||
* [http://search.twitter.com/search?q=%23roo Twitter hash code #roo search] |
|||
* [http://www.springhub.com/index.php?option=com_search&Itemid=5&searchword=Tag%3A+Spring+Roo&submit=Search&searchphrase=exact&ordering=newest Spring Roo Resources] |
|||
* [http://www.lalitbhatt.com/tiki-index.php?page=Spring+Roo Spring Roo Tutorial with Video] |
|||
* [https://www.packtpub.com/spring-roo-1-1-cookbook/book Spring Roo 1.1 Cookbook] |
|||
{{Java (Sun)}} |
{{Java (Sun)}} |
||
[[Category:Free |
[[Category:Free computer libraries]] |
||
[[Category:Free software programmed in Java]] |
[[Category:Free software programmed in Java (programming language)]] |
||
[[Category:Java development tools]] |
[[Category:Java development tools]] |
||
[[Category:Java enterprise platform]] |
[[Category:Java enterprise platform]] |
||
[[Category:Web |
[[Category:Web frameworks]] |
||
[[ru:Spring Roo]] |
Latest revision as of 01:16, 19 November 2024
Developer(s) | DISID, Pivotal Software |
---|---|
Stable release | 1.3.2
/ September 1, 2015 |
Preview release | 2.0.0.RELEASE
/ September 30, 2019 |
Written in | Java |
Platform | Java SE |
Type | Rapid application development |
License | Apache License 2.0 |
Website | projects |
Spring Roo is an open-source software tool that uses convention-over-configuration principles to provide rapid application development of Java-based enterprise software.[1] The resulting applications use common Java technologies such as Spring Framework, Java Persistence API, Thymeleaf, Apache Maven and AspectJ.[2] Spring Roo is a member of the Spring portfolio of projects.
Motivation and history
[edit]Spring Roo's mission statement is to "fundamentally improve Java developer productivity without compromising engineering integrity or flexibility".[3]
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).[4] Ultimately the name "Spring Roo" was preferred over alternatives including Spring Boost, Spring Spark, Spring HyperDrive and Spring Dart.[5]
Several releases followed,[6][7] with the Roo 1.0.0.RELEASE (general availability) released in December 2009. In October 2010, Spring Roo 1.1.0.RELEASE was released. The 1.1.0 release moved to an OSGi foundation with associated add-on discovery model, plus added support for incremental database reverse engineering, Spring MVC page complexity reduction, Google Web Toolkit, Google App Engine, Apache Solr, JSON and smaller features like serializable automation.[8] The current Roo project engineers are employed by SpringSource and as such Roo releases typically support the latest available releases of other Spring portfolio projects.
In 2014 DISID takes over the leadership of the open source framework Spring Roo after the partnership agreement with Pivotal. They collaborate on further development of the Spring Roo project. Roo will continue in its goal of providing a code-gen style of RAD framework.
The Spring Roo project will remain as an open source project under Spring, maintaining the same current licensing policy. Both Pivotal and DISID are calling on the Spring and Java communities for anyone who would like to collaborate in the project.
Standards and technology compatibility
[edit]Roo's default installation facilitates the creation of applications that comply with the following standards and major technologies:[9]
- Apache ActiveMQ (as an embedded JMS implementation)
- Apache Maven (version 3.2 or above)
- Apache Tomcat (embedded execution support)
- AspectJ (used for AOP plus mixins to achieve separation of concerns)
- AspectJ Development Tools (Eclipse plugin)
- Bootstrap (version 3.3.6 or above)
- Cloud computing (via SpringSource Cloud Foundry, Google App Engine and VMforce)
- Eclipse IDE (concurrent execution and project metadata creation)
- EclipseLink (as a JPA implementation)
- Hibernate (as a JPA implementation)
- Java Bean Validation (JSR 303) (including Hibernate Validator)
- Java API for XML Web Services (both services and clients)
- Java Message Service (both message producers and consumers)
- Java Persistence API (multiple implementations)
- Java Transaction API (via Spring transaction abstraction)
- Java (version 5, 6 or 7). Java 7 is supported since Roo 1.2.4.[10]
- JQuery (version 1.11 or above)
- JSON (REST support)
- JUnit (automated tests for user projects)
- Log4J (installation and configuration)
- OSGi (the Roo tool is built on OSGi)
- Representational State Transfer (REST)
- Spring Boot (version 1.4 or above)
- Spring Data JPA (version 1.10 or above)
- Spring Framework (version 4 or above)
- Spring Security (version 4 or above)
- Spring Web Flow (installation and flow definition)
- SpringSource Tool Suite (STS has an embedded Roo shell and Roo command helpers)
- Thymeleaf (version 3 or above)
The above list can be augmented through additional Roo add-ons, which provide Roo's method of extensibility.
User interface
[edit]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 goal 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 (i.e. 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 application plus the Spring Boot Maven plugin run goal to compile and run the application using an embedded HTTP server:
$ mkdir hello
$ cd hello
$ roo.sh
roo> project setup --topLevelPackage com.foo
roo> jpa setup --provider HIBERNATE --database HYPERSONIC_IN_MEMORY
roo> entity jpa --class ~.domain.Timer
roo> field string --fieldName message --notNull
roo> repository jpa --all
roo> service --all
roo> web mvc setup
roo> web mvc view setup --type THYMELEAF
roo> web mvc controller --all --responseType THYMELEAF
roo> web mvc controller --all --pathPrefix /api
roo> quit
$ mvn spring-boot:run
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.
Architecture
[edit]While there are many ways that software can automatically generate code,[11] Roo operates by 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.[12][13][14]
Spring Roo uses add-ons to provide all the functionality within and on top of an OSGi runtime system based on Apache Felix.
Base add-ons
[edit]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 2.0.x include:
- Add-On Creator: enables easy creation of third-party Roo add-ons
- 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)
- Configurable: introduces Spring Framework's @Configurable annotation (primarily used by other add-ons)
- Database reverse engineering: allows incremental reverse engineering of relational databases
- Data on Demand: provides seed data that is compliant with JSR 303 (JavaBean Validation) annotations present in entities
- DTO: extensive support for automatically maintaining Data Transfer Objects
- Email: simplifies setup of SMTP-based emails and mail sender support via Javamail
- Entity: extensive support for automatically maintaining Java Persistence API @Entity classes
- Java Bean: automatically maintains JavaBean getters/setters for classes with an @RooJavaBean annotation
- JDBC: encapsulates OSGi-compliant access to JDBC drivers shipped in different bundles (primarily used by other add-ons)
- 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
- JSON: adds JSON related serialization and deserialization methods to POJOs
- Logging: sets up Log4j, including command-based log level configuration
- 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
- Test: produces JUnit integration tests for project classes
- ToString: produces a valid toString() method for any class with the @RooToString annotation
- Web Flow: installs the Spring Web Flow and creates a default flow
- Web MVC: maintains the view layer based on Spring MVC plus Thymeleaf templates and the RESTful API
- WS: produces SOAP services and SOAP clients
Roo core modules
[edit]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
- Felix: integrates with Apache Felix, such as providing "osgi" commands in the Roo shell
- OBR: adds Apache Felix OSGi Bundle Repository capabilities
- URL Stream: encapsulates access to downloads in different host environments (Roo shell, IDE embedding) and enforces the Pretty Good Privacy-based httppgp:// protocol handler
Differentiation
[edit]Spring Roo differentiates from other convention-over-configuration rapid application development tools in the following major ways:[15]
- 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)[16] and Roo's AspectJ inter-type declarations can be "pushed in" to standard *.java compilation units.[17][18]
- Extensibility: Roo's separation of core infrastructure and base add-ons intends to allow third parties to easily extend Roo.[19][20]
See also
[edit]- Grails (framework)
- Griffon (framework) – A Desktop framework inspired by Grails
- Play Framework
References
[edit]- ^ "InfoWorld: SpringSource CEO to tout Roo, a new Java enhancement" by Paul Krill; Dated 2009-06-01.
- ^ "SD Times: Roo released to handle repetitive Spring tasks" Archived 2012-02-25 at the Wayback Machine by Alex Handy; Dated 2009-10-19.
- ^ "Spring Roo reference documentation", Mission Statement section; Retrieved 2010-2-21.
- ^ "Tech Videos: The Future of Java Innovation" Archived 2009-10-09 at the Wayback Machine by Rod Johnson (CEO of SpringSource); Retrieved 2009-10-17.
- ^ "Spring Roo reference documentation", History section; Retrieved 2010-2-21.
- ^ "InfoQ: Spring Roo 1.0 M1 Released" by Srini Penchikala; Dated 2009-5-31.
- ^ "Jira issue tracking for Spring Roo Project releases"; Retrieved 2010-2-21.
- ^ "A Big Hop Forward: Spring Roo 1.1.0 Is Released!" Archived 2010-10-28 at the Wayback Machine, by Ben Alex (lead of Spring Roo at SpringSource); Retrieved 2010-10-27.
- ^ "TechCast: Spring Roo podcast" Archived 2010-02-23 at the Wayback Machine by Ken Rimple; Retrieved 2010-2-21.
- ^ "Spring Roo 1.2.4.RELEASE available now " Dated 2013-10-17.
- ^ "InfoQ: Role of Code Generation in Java Development" by Srini Penchikala; Dated 2009-9-3.
- ^ "InfoQ: Introduction to Spring Roo 1.0.0 Video Presentation", by Ben Alex (lead of Spring Roo at SpringSource); Retrieved 2010-2-21.
- ^ "JAX Italia 2009 Conference: Spring Roo" by Massimiliano Dessì; Retrieved 2010-2-21.
- ^ "Philadelphia Java User Group: Spring Roo" by Ken Rimple; Retrieved 2010-2-21.
- ^ "Spring Roo Home Page"; Retrieved 2010-2-21.
- ^ "Sun Java 5 JavaDocs for RetentionPolicy.SOURCE" by Sun Microsystems; Retrieved 2009-10-17.
- ^ "Push-In Refactoring for AJDT" by Andrew Eisenberg (AJDT project lead at SpringSource); Retrieved 2009-10-17.
- ^ "Eclipse AJDT intertypes and Push-In refactoring" Archived 2010-01-17 at the Wayback Machine by Dhruba Bandopadhyay; Dated 2009-12-31.
- ^ "Italian Java User Group JavaDay IV Conference: Spring Roo Internals" by Massimiliano Dessì; Retrieved 2010-2-21.
- ^ "Spring, Roo, and Alfresco Too: What Alfresco Gave to Spring and Why" by Jeff Potts; Dated 2009-12-16.