jcconf2014 roo and_grails

22
既生瑜, 何生亮 ROO GRAILS 的瑜亮情節

Upload: shin-jan-wu

Post on 10-Jul-2015

109 views

Category:

Engineering


0 download

TRANSCRIPT

Page 1: Jcconf2014 roo and_grails

既生瑜, 何生亮

ROO 和 GRAILS 的瑜亮情節

Page 2: Jcconf2014 roo and_grails

現任職電信業

Codedata

MOPCON 2014

吳欣展

pcbill

Page 3: Jcconf2014 roo and_grails

Web Application

Page 4: Jcconf2014 roo and_grails

Layer

Page 5: Jcconf2014 roo and_grails

MVC

Page 6: Jcconf2014 roo and_grails

Convention Over Configuration

a software design paradigm which seeks to decrease the number of decisions that developers need to make, gaining simplicity, but not necessarily losing flexibility.

--Wikipedia

Page 7: Jcconf2014 roo and_grails

● Groovy○ Script on JVM○ Domain-Specific Languages

■ Grails, Gradle, Geb○ Closure

● web framework○ No XML Configuration○ GORM○ GSP/GString

Grails

Page 8: Jcconf2014 roo and_grails

● Groovy○ Script on JVM○ Domain-Specific Languages

■ Grails, Gradle, Geb○ Closure

● web framework○ No XML Configuration○ GORM○ GSP/GString

Grails

Page 9: Jcconf2014 roo and_grails

● CLI○ > grails create-controller Book

○ creates a class in the grails-app/controller directory

○ http://localhost:8080/book/list

Grails

Page 10: Jcconf2014 roo and_grails

Roo

Page 11: Jcconf2014 roo and_grails

Roo

● Java● Web is optional● No Runtime/jar● Fast and Simple to remove● AspectJ

Page 12: Jcconf2014 roo and_grails
Page 13: Jcconf2014 roo and_grails

Roo

CLI

Page 14: Jcconf2014 roo and_grails

Roo

CLI

roo> project --topLevelPackage com.aspectj.rocksroo> jpa setup --database HYPERSONIC_IN_MEMORY --provider HIBERNATEroo> entity jpa --class ~.HelloCreated SRC_MAIN_JAVA/com/aspectj/rocksCreated SRC_MAIN_JAVA/com/aspectj/rocks/Hello.javaCreated SRC_MAIN_JAVA/com/aspectj/rocks/Hello_Roo_JpaActiveRecord.ajCreated SRC_MAIN_JAVA/com/aspectj/rocks/Hello_Roo_JpaEntity.ajCreated SRC_MAIN_JAVA/com/aspectj/rocks/Hello_Roo_ToString.ajCreated SRC_MAIN_JAVA/com/aspectj/rocks/Hello_Roo_Configurable.ajroo> field string --fieldName commentManaged SRC_MAIN_JAVA/com/aspectj/rocks/Hello.javaManaged SRC_MAIN_JAVA/com/aspectj/rocks/Hello_Roo_JavaBean.ajManaged SRC_MAIN_JAVA/com/aspectj/rocks/Hello_Roo_ToString.aj

Page 15: Jcconf2014 roo and_grails

Code GeneratorFramework

Page 16: Jcconf2014 roo and_grails
Page 17: Jcconf2014 roo and_grails

Code GeneratorFramework

Page 18: Jcconf2014 roo and_grails

Spring Boot

Bootify Your Spring Applications -- JCConf 2014

Page 19: Jcconf2014 roo and_grails

● Easy to create stand-alone, production-grade Spring based Applications that can you can "just run".

● Provide opinionated 'starter' POMs to simplify your Maven configuration

● Embed Tomcat or Jetty● Automatically configuration● No code generation, No XML configuration● Production Ready ● Microservices

Spring Boot

Page 20: Jcconf2014 roo and_grails

How about Grails 3.0 ?

Grails 3.0 will be based on Spring Boot, feature advanced Gradle support and the ability to build a range of application types from Micro services to traditional web applications.

(https://spring.io/blog/2014/05/21/grails-2-4-released)

Page 21: Jcconf2014 roo and_grails
Page 22: Jcconf2014 roo and_grails

Thank You