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

29
Rapid Application Development with Rapid Application Development with SpringRoo Baris Dere

Upload: baris-dere

Post on 25-May-2015

2.283 views

Category:

Documents


0 download

TRANSCRIPT

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

Rapid Application Development withRapid Application Development with SpringRoop g

Baris Dere

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

Agenda

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

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

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

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

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

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)

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

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

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

DEMODEMO

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

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

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

Why use it? (2)

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

experience

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

Why use it? (3)

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

architecture

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

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

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

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

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

Why use it? (6)

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

approach• no dynamic proxy creation overhead

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

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

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

DEMODEMO

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

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

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

SpringRoo architecture (2)

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

SpringRoo architecture (3)

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

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

SpringRoo architecture (4)

• Core components

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

SpringRoo architecture (5)

AspectJ ITD’s for “active” generation

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

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

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

SpringRoo architecture (7)

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

applications– Request ROO-301 - Vote

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

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

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

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

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

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

[email protected]

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

Add-ons

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

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

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

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

Roadmap and resources

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

• Documentation• Project resources

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

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

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

QUESTIONS?QUESTIONS?