• Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
Introduction To Spring Roo 1.0.0
 

Introduction To Spring Roo 1.0.0

on

  • 25,186 views

Introducing Spring Roo 1.0.0, which is a Java-based rapid application development framework. This presentation represents an updated version of the session I delivered at SpringOne USA in October ...

Introducing Spring Roo 1.0.0, which is a Java-based rapid application development framework. This presentation represents an updated version of the session I delivered at SpringOne USA in October 2009.

Statistics

Views

Total Views
25,186
Views on SlideShare
19,496
Embed Views
5,690

Actions

Likes
15
Downloads
684
Comments
4

23 Embeds 5,690

http://www.ksug.org 3890
http://myartaud.free.fr 504
http://vifito.eu 391
http://blog.ksug.org 210
http://springframework.tistory.com 190
http://www.slideshare.net 171
http://ksug.org 120
http://www.vifito.eu 101
http://yunsunghan.tistory.com 64
http://feeds.feedburner.com 12
http://dev.vifito.eu 8
http://community.dataflow.be 7
http://railsandruby.blogspot.com 6
http://www.linkedin.com 4
http://www.hanrss.com 3
http://mail.vifito.eu 2
http://myartaud.online.fr 1
http://www.docseek.net 1
http://webcache.googleusercontent.com 1
http://www.techgig.com 1
http://localhost:8080 1
http://www.lmodules.com 1
url_unknown 1
More...

Accessibility

Categories

Upload Details

Uploaded via as Adobe PDF

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

14 of 4 previous next Post a comment

  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

    Introduction To Spring Roo 1.0.0 Introduction To Spring Roo 1.0.0 Presentation Transcript

    • Introducing Spring Roo 1.0.0 Extreme Productivity in 10 Minutes Ben Alex, Project Lead, Spring Roo Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited.
    • Agenda • Introducing Roo • Capability Areas • Using Roo • Roadmap and Resources Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 2
    • Agenda • Introducing Roo • Capability Areas • Using Roo • Roadmap and Resources Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 3
    • Mission Statement “Roo's mission is to fundamentally and sustainably improve Java developer productivity without compromising engineering integrity or flexibility” Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 4
    • End User's Description “Roo is a little genie who sits in the background and handles the things I don't want to worry about” Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 5
    • What Is Roo? • Roo is an extensible, text-based RAD tool for Java • Roo is development-time only (no Roo runtime) Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 6
    • Implementation Overview Roo Infrastructure Roo STS Roo provide Add-Ons Roo @Roo Add-Ons Roo Add-Ons Annotations Add-Ons Shell source only monitor and retention change User's Project .aj .java .xml .jsp .properties Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 7
    • Easy To Learn and Use • Usability you'll love – “hint” and “help” commands to guide you all the way – TAB completion for nearly everything – Command hiding and automatic contextual awareness – Even if you make a mistake, Roo will rollback changes! • Scriptable UI that can even “replay” scripts • You're in charge and Roo won't get in your way – Roo acts predictably and conservatively at all times Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 8
    • Familiar Libraries • Roo builds on what you already know – Popular, proven, and mature APIs at your full disposal • Java • Spring Framework • Java Persistence API (Hibernate) • Java Server Pages • Spring Security • Spring Web Flow • Log4J, Maven, AspectJ, Eclipse/STS... Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 9
    • Uses Java's Strengths • The world's most popular language (Tiobe) – Skills availability, vendor choice, low risks, open source • APIs are popular, standardised, safe, proven • Quality, mature and deep tooling integration – IDE code assist, debuggers, refactoring, profilers etc • Static typing – Fewer errors, robust refactoring, code assist, JVM design Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 10
    • Cloud-Class Scalability • Zero performance overhead – Efficient, reflection-free code – No dynamic proxies, deferred compiling, LTW or similar – No Roo runtime means no runtime performance cost • Zero memory overhead – No class creation means no Perm Gen memory issues – No Roo runtime means no runtime memory cost • Zero deployment footprint – Roo apps leverage OSGi bundles out-of-the-box – No Roo runtime means no WAR footprint size Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 11
    • More Great Stuff • No lock-in – Get rid of Roo from your project in under 10 minutes! • Easy to write and deploy your own Roo add-ons – Roo can even write them for you (seriously!) • Open source and SpringSource maintained – SpringSource-endorsed application architecture • Consistent apps across your team and enterprise Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 12
    • Code Generation Approach • Roo is a hybrid code generator – The best of the passive and active generation models – Achieved by use case-specific design decisions • Passive generation – Use Roo shell to make Roo generate something – It's done and it's finished (usually .xml and .java files) • Active generation (automatic round-tripping) – Builds detailed metadata model with help of @Roo* – Incrementally updates .aj, .jsp files - never .java files Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 13
    • Active Generation AspectJ ITDs Person_Roo_ write Roo read Person.java ToString.aj Roo Add-Ons Roo Add-Ons Roo name:String toString():String Add-Ons Add-Ons Person_Roo_ JavaBean.aj read AspectJ read getName():String Compiler setName(String):void Person.class write Compilation unit separation name:String toString():String with automated round-trips getName():String setName(String):void Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 14
    • Demo #1 The Roo Tour: A Web App Without Reading The Manual (or blogs, web sites, samples, pre-written code or similar) Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 15
    • Agenda • Introducing Roo • Capability Areas • Using Roo • Roadmap and Resources Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 16
    • Out Of The Box • Project management • General object services • Entity support • Field management • Persistence • JUnit testing • Dynamic finders • Spring MVC, Spring Web Flow and Selenium • JMS, SMTP and build system integration • Spring Security, Logging Setup..... Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 17
    • Project Management • Commands – “project” → creates new project in current dir – “dependency add” → adds dependency to POM – “dependency remove” → opposite of add – “backup” → creates ZIP of project • All dependencies use Enterprise Bundle Repo – Versioned, quality-checked, OSGi-compatible JARs Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 18
    • General Objects • Roo annotations suitable for any class – @RooJavaBean – getters and setters for free – @RooConfigurable – adds Spring @Configurable – @RooToString – you guessed it • Roo will automatically maintain the code for you • Roo won't get in your way – It just sits in the background and writes code you don't – You don't have to “tell” it to stop doing something – You don't have to use the Roo shell (any editor will do) Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 19
    • Entity Support • “entity” → creates an @RooEntity – Delivers a flexible, feature-rich JPA entity – Declares a JPA @Entity with id, version, EntityManager and a no-arg constructor – Automatically adds count, findAll, findById, findEntries, persist, remove, merge and flush methods to an entity • Command accepts many optional directives – Whether to build an automatic integration test – Table name, identifier column name etc Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 20
    • Field Management • “field” commands for most major field types • Field commands have options for – JPA-specific annotations (--fetch, --column etc) – JavaBean valiation-specific annotations (--max etc) – Java modifiers (--primitive, --transient etc) • Shell remembers last entity you worked with – Fields are automatically added to that entity – Override using --class Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 21
    • Persistence • “persistence setup” – Use --provider for Hibernate, OpenJPA and EclipseLink – Use --database for most common databases • Related commands – “persistence exception translation” → via AspectJ – “database properties list” → lists JDBC props – “database properties set” → changes JDBC prop – “database properties remove” → deletes JDBC prop • You can re-run “persistence setup” at any time – Switch from Hibernate to OpenJPA in one line! Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 22
    • JUnit Testing • “test integration” → JUnit integration test – Automatic “data on demand” feature for seed data – This is implied with “entity --testAutomatically” • “test mock” → JUnit mock test – Allows test mocking of static methods in your entities • “dod” → creates a data on demand class – Rarely used directly – Automatically created if tests require it Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 23
    • Dynamic Finders • Saves you having to write JPA QL finders – Roo will write them for you, complete with type safety! • Finders are added as static methods to entities – They're even compatible with abstract entities – “finder list” → shows all available finders – “finder add” → enable a specific finder Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 24
    • Easy Spring Web MVC • “controller scaffold” → an automatic controller – Automatic REST controller for a given entity – Automatic JSP creation and maintenance – Can fine-tune allowed methods (CRUD subset) – Permits date format to be specified • “controller all” → automatically scaffold all entities • “controller class” → stub a manual controller – Just the controller – you write the rest Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 25
    • Web Stack • Automatic Spring JS, Tiles and URL Rewrite • “selenium test” → Test a scaffolded controller – Start Tomcat with “mvn tomcat:run” – Then run the test with “mvn selenium:selenese” • “webflow” → Create a flow with Spring Web Flow Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 26
    • Messaging: SMTP and JMS • “email sender setup” → setup SMTP sender • “field email” → adds an email sender field • “jms setup” → sets up JMS support – Optionally embeds a TCP-accessible ActiveMQ instance • “field jms template” → adds a JMS sender field • “jms listener class” → makes a JMS receiver Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 27
    • Build System Integration • Assorted build options – “perform clean” → runs “mvn clean eclipse:clean” – “perform eclipse” → runs “mvn eclipse:eclipse” – “perform tests” → runs “mvn test” – “perform package” → runs “mvn package” – “perform command” → custom mvn command • You must have Maven setup and in path to use • Often used at end of “script” files – Verifies success – Brings project into Eclipse for further work Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 28
    • Miscellaneous • “security setup” → sets up Spring Security • “logging setup” → sets up Log4J configuration • “script” → executes a script – Specify clinic.roo, wedding.roo, vote.roo and bundlor.roo for inbuilt sample applications – Specify a fully-qualified file system path for your files Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 29
    • Demo #2 Exploring “script clinic.roo” Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 30
    • Agenda • Introducing Roo • Capability Areas • Using Roo • Roadmap and Resources Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 31
    • Requirements • Java 5 – Same as Spring 3 • Maven 2.0.9 or above – Roo itself doesn't need Maven installed to work – Maven is only needed for Roo-generated projects – ROO-91 requests Ant/Ivy → vote if you'd like it! • Tested with Linux, Windows and Apple – All platforms support tab completion and a colour shell Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 32
    • Download and Easy Install • Download Roo from www.springsource.org/roo – Simply unzip and add to your path • Linux/Apple users would use something like: – sudo ln -s $HOME/spring-roo- 1.0.0.RELEASE/bin/roo.sh /usr/bin/roo • Windows – Add %HOME%/spring-roo-1.0.0.RELEASE/bin to PATH • A public Subversion repository is also available – See readme.txt in root of checkout for dev installation Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 33
    • IDE Interoperability • We highly recommend SpringSource Tool Suite – Download it from www.springsource.com – Totally free to use – Includes Roo integration (eg CTRL-ALT-R commands) – Also pre-bundles AJDT and other useful IDE plugins • Eclipse also works, but use the latest AJDT – Eclipse does not provide STS' Roo integration – Roo can still be used concurrently via the shell • Roo also happily lives alongside emacs, vim, notepad, and no IDE at all Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 34
    • Lifecycle Notes • SpringSource Tool Suite – Use the embedded Roo option • Any other case – Load Roo at the same time as your IDE or text editor – Roo automatically detects changes made outside Roo • No need to add Roo to your build system – Although “roo quit” will run Roo, update files and exit Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 35
    • Upgrade Actions • When you upgrade Roo, .aj files may change – This is a feature of active code generation – We make optimizations and enhancements in .aj files • Please refrain from editing Roo's .aj files – Roo “owns” the *_Roo_*.aj files – You can freely edit any file in your project except these • Just “push-in refactor” any .aj files you wish to edit Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 36
    • Removing Roo in Three Steps 1. Use AJDT's “push-in refactoring” feature – This moves the Roo .aj content into normal .java files 2. Remove Roo's annotation JAR from your POM – You can use Roo's “dependency remove” command 3. Remove @Roo* annotations from .java files – Use a regular exp find/replace in Eclipse for speed • You can still use Roo on the project again – Its “hands off by default” will ensure it's problem-free Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 37
    • Roo Internals • “development mode” → full exception tracing • “poll status” → auto-scaled file monitoring stats • “poll speed” → adjust auto-scaled file monitoring • “poll now” → force an immediate file scan • “metadata status” → metadata statistics • “metadata for type” → metadata summary • “metadata for id” → metadata information Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 38
    • Add-On Services • Third parties can easily publish new add-ons – See the addon.roo script • “addon list” → lists add-ons presently installed • “addon install” → downloads and installs add-on • “addon uninstall” → removes an add-on • “addon cleanup” → refreshes the environment Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 39
    • Recommendations • Use SpringSource Tool Suite • Don't remove Roo from your projects – You'll have much code to now manage by hand again – You'll miss out on automatic upgrade improvements – Consider removal as your insurance against lock-in • Record your jump-start applications as scripts – It's now so quick to change your design, so enjoy it! – Defer custom coding until your model seems correct • Ask questions on the forum for fast support Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 40
    • Demo #3 Roo IDE Integration Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 41
    • Agenda • Introducing Roo • Capability Areas • Using Roo • Roadmap and Resources Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 42
    • Present Release • Spring Roo 1.0.0.RELEASE • Released 31 December 2009 • Extensive community feedback over 8 releases • Plenty of documentation and tutorials included Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 43
    • Project Resources • Home → http://www.springsource.org/roo – Contains links to all other resources • Forum → http://forum.springsource.org – Roo team actively monitor forum and answer queries • Issues → http://jira.springframework.org/browse/ROO • Twitter → #roo hash key Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 44
    • Conclusion • Roo delivers serious productivity gains for Java – Popular, proven technologies you already know – Easy to learn and easy to use – Builds on Java's strengths – Extreme performance – No runtime, no lock-in, no risk • An active, supported, open source project • Questions? balex@vmware.com Copyright 2009 SpringSource. Copying, publishing or distributing without express written permission is prohibited. 45