Rapid application development with spring roo j-fall 2010 - baris dere

Preview:

Citation preview

Rapid Application Development withRapid Application Development with SpringRoop g

Baris Dere

Agenda

• SpringRoo introduction• Why use it?• Beginning with SpringRooBeginning with SpringRoo• SpringRoo architecture

Add• Add-ons • Usage and conventions• Roadmap and resources

About Me

• Senior Software Engineer / Technical Lead• 11 years experience with Java• SCJP SCJD SCWCD SCBCDSCJP, SCJD, SCWCD, SCBCD,

SCEA(in progress)• MCP MCAD NET• MCP, MCAD.NET• RUP Certified• Author for Java Magazine in Turkey

SpringRoo introduction (1)

• Open source (Spring subproject)• Released in December 2009 (version 1.0)• Ben Alex – LeadBen Alex Lead• Java 5 JDK or higher

A h M 2 0 9 hi h• Apache Maven 2.0.9 or higher• Latest stable version 1.1.0 (October 2010)

SpringRoo introduction (2)

• Extensible, text based RAD tool• Command-line shell or STS• Active/Passive code generationActive/Passive code generation• Maintaining files during project lifecycle

N t ti (d l t ti l )• Not a runtime (development-time only)• Not an IDE plugin

DEMODEMO

Why use it?

• Higher Java productivity• Stock-Standard Java• Usable and LearnableUsable and Learnable• Easy to remove

N E i i T d Off• No Engineering Trade-Offs

Why use it? (2)

• Higher Java productivity– Takes days to start a new project– Reuse their existing knowledge, skills and

experience

Why use it? (3)

• Stock-Standard Java– Existing Java knowledge– Commonly used technologies– SpringSource-certified best-practice application

architecture

Why use it? (4)

• Usable and Learnable– Text-based interfaces are often more appropriate

than GUIs– Tab-based completion system– Contextual awareness– Command abbreviation– “hint” command

Why use it? (5)

• Easy to remove– Risks to use a tool– SpringRoo does not exist at runtime– Easy to remove SpringRoo

• Push in refactor• Regular expression based find and replace

Why use it? (6)

• No Engineering Trade-Offs– Incremental dependency addition approach– AspectJ's excellent compile-time weaving

approach• no dynamic proxy creation overhead

Beginning with SpringRoo

• Installation• Starting a typical project

– Persistent layer / Reverse Engineeringy g g– Web layer– Integration and Selenium testsIntegration and Selenium tests– Securing the application– IDE supportIDE support– Customizing– BackupBackup

DEMODEMO

SpringRoo architecture

• Command-line shell• Core components• AspectJ ITD’s for “active” generationAspectJ ITD s for active generation• Optional Services Layer

N DAO L• No DAO Layer• Add-ons

SpringRoo architecture (2)

SpringRoo architecture (3)

• Command-line shell– Perform a “startup” scan– Monitor file system– Handle explicit directives from the user

SpringRoo architecture (4)

• Core components

SpringRoo architecture (5)

AspectJ ITD’s for “active” generation

SpringRoo architecture (6)

• Optional Services Layer– Most logic can be placed in the web controller

• Exceptions:p– Need multiple entities– Business logic callable from outside (remote, timer,Business logic callable from outside (remote, timer,

etc)– Easier to test (mock http requests)( p q )

• Create Services Layer– Annotate your service class with @ServicesAnnotate your service class with @Services

SpringRoo architecture (7)

• No DAO Layer– Not strictly essential to creating typical web

applications– Request ROO-301 - Vote

Add-ons

• Adobe Flex• Apache ActiveMQ

• Java Bean Validation• Java Database Connectivity

• SpringSource Tool Suite• Spring Integration

• Apache Maven• Apache OpenJPA• Apache Tiles

y• Java Message Service• Java Persistence API• Java Transaction API

g g• Spring Framework• Spring Security• Spring Web Flow

• Apache Tomcat• AspectJ• AspectJ Development Tools• Cloud computing

• Java Server Pages• Jetty• JUnit• Log4J

• URL Rewrite Filter• Web application resource

(WAR) packaging

• Cloud computing• Dojo Toolkit• Eclipse IDE• EclipseLink

• Log4J• Representational State

Transfer (REST)• Selenium

• Google Web Toolkit• Google App Engine• Hibernate

J 5

• OSGi add-ons• Solr search• SpringSource tc Server with

Insight• Java 5+ Insight

Add-ons (2)

addon create simple --topLevelPackage com.mycompany.myproject.roo.addon

• Create a CommandMarker implementationAnnotate with @ScopeDevelopmentShell

p p g y p y yp j

• Annotate with @ScopeDevelopmentShell• Create a command method• Annotate with @CliCommand(value=“”,

title=“”)• Create a command available method• Annotate with @CliAvailabilityIndicator(“”)• Annotate with @CliAvailabilityIndicator( )• Perform package

Add-ons (3)

• Version 1.1.0 (27th of October 2010)• Apache Felix – OSGi Framework• Service Component Runtime for componentService Component Runtime for component

management• OSGi Bundle Repository for bundle resolution• OSGi Bundle Repository for bundle resolution• Out-of-the-box hosting on Google Code• PGP based security infrastructure• Email OBR repository URL to s2-p y

roobot@vmware.com

Add-ons

addon create simple --topLevelPackage com mycompany myproject roo addonaddon create simple topLevelPackage com.mycompany.myproject.roo.addon

Usage and conventions

• File conventions– Roo will never change a .java in your project unless

you explicitly ask it– Only .jspx and *_Roo_*.aj updated– Never change the *_Roo_*.aj files

• IDE Usage– Use AJDT pluginp g

• Shell features– Save your Roo commandsSave your Roo commands– Hinting, tab completion

Roadmap and resources

• More Add-ons– Comet & Bayeux– Ajax (partial page refresh)– Ordering & sorting of entities

• Documentation• Project resources

Project resources

• Project home:– http://www.springsource.org/roo

• Forum:– http://forum.springsource.org/roo

• Issues:Issues:– https://jira.springframework.org/browse/ROO

• Twitter:• Twitter:– @SpringRoo

QUESTIONS?QUESTIONS?