cours iut – csid 2012arnaud.nauwynck.free.fr/coursiut/coursiut-springroo.pdf · an introduction...

31
Cours IUT – CSID 2012 An Introduction to Spring Roo [email protected]

Upload: others

Post on 28-May-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Cours IUT – CSID 2012

An Introduction to Spring Roo

[email protected]

Page 2: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Outline

● What is Spring Roo ?● Self-trained, documentations● 5 Minutes demo● Explained design principles● Eclipse and Roo

Page 3: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

In few Words

● Tool to Create a complete Web application ● In 2 Minutes● Including Database Persistence● With standards JAVA libraries only● No runtime dependency

● Make Java FUN, FAST, EASY

Page 4: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

http://www.infoq.com/presentations/Introducing-Spring-Roo

Page 5: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Roo : Shell, Hint Command

Page 6: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Why I didn't Heard About It Before ?

● Strange name … ● ROO = Real Object Oriented ● Now “Roo” … a name by itself

● Recent : 1.0.0.RELEASE in December 2009

● Concurrenced by Grails, Rails, Php● Roo is “only“ a tool above java standards

● Many many Java standards (spring, jpa, web, …)● Simple but underlying frameworks are “not”

Page 7: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Google - Spring Roo

Page 8: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Roo Home: http://www.springsource.org/spring-roo

Page 9: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Wikipedia - Spring Roo

Page 10: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Spring Roo Wikipedia ExplainedIn githubby springsource

shell window+ code generator .. NO runtime

Like Ruby-On-Rails, Grails

Simplify code (spring annotations ...)

Standards JAVA

Page 11: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Roo = Java Standards

Extensibitly Plugins

Page 12: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Comparison Building Blocks – Strength

PHP

Grails (runtime ... Groovy syntax)

PythonRuby

Java JVM --- Stable - Efficient

Oracle SunSTABLE …But NO Innovation

Glue: Spring, Maven, AspectJ ... Jakarta, SpringSource, Eclipse, ...(Open Source )

Roo SpringSource, OpenSourceINNOVATION

Custom Langages,Isolated, Un-efficientRe-invent wheel

JdbcHibernate

Jsp JSRs Mail,Jms

RestJson

Page 13: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Rod Johnson: the Future Of Java Innovation

Page 14: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Install

Page 15: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Getting Started

● Open shell window, Type “roo”

● Interactively :● Type “hint” for wizard● “tab” for autocompletion on mandatory args● “--” then “tab” for optional args● “help” : list all commands● “help <<command>>”

● Execute tutorial script “script <<file>>”

Page 16: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Sample Script

● Cf in roo/examples/<<project>>.roo● Cf in your project log.roo● Sample:

Page 17: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Compile, Test & Run It

● Compile:● Use maven from shell: $ mvn install● From roo: roo> perform package

● Test:● $ mvn tomcat:run● open http://localhost:8080/test

● Import in Eclipse:● Using m2eclipse … import as maven project● (old: “perform eclipse” or “mvn eclipse:eclipse” )

Page 18: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Running CRUD !

create

Create

list, new, edit, delete

List

Show, edit, delete

list

UpdateShow

Page 19: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Small Is Beautiful … KISS

● See ALL User Code in Eclipse (not Generated )

Page 20: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Where Is The Magic ?

Page 21: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

User Code + ITD ==AspectJ==> Bytecode

Page 22: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Video – Demo Tutorial

http://s3.springsource.com/MRKT/roo/2010-01-Five_Minutes_Roo.mov

Cf from Home Page :

Page 23: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Video from Ben Alexhttp://www.infoq.com/presentations/Introducing-Spring-Roo

Page 24: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Tutorial

Page 25: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Books

http://spring-roo-repository.springsource.org/Getting_Started_with_Roo.pdf

Page 26: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Source Code

Page 27: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

http://www.infoq.com/presentations/Introducing-Spring-Roo

Page 28: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,
Page 29: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Eclipse AspectJ – Push In...

Page 30: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Happy Runtime End – Roo is gone

Page 31: Cours IUT – CSID 2012arnaud.nauwynck.free.fr/CoursIUT/CoursIUT-SpringRoo.pdf · An Introduction to Spring Roo arnaud.nauwynck@gmail.com. Outline ... Concurrenced by Grails, Rails,

Conclusion

Spring Roo is Beautifull !!

Questions ?

[email protected]