![Page 1: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/1.jpg)
Thursday, April 28, 2011
![Page 2: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/2.jpg)
JavaEE and Google AppEngine
Aleš Justin, JBoss by Red Hat
Thursday, April 28, 2011
![Page 3: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/3.jpg)
•What is GAE and CDI?•Why GAE and CDI?•Other JavaEE technologies•Development vs. Production•Problems vs. Solutions•Testing•Q & A
Agenda
Thursday, April 28, 2011
![Page 4: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/4.jpg)
•Old school JBoss-ian•Microcontainer co-author•Weld lead•RHT Cloud “guinea pig”
•Eager PaaS user•While still GAE amateur
About me
Thursday, April 28, 2011
![Page 5: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/5.jpg)
•Forked Jetty•Many (logical) restrictions•RDBMS → BigTable•Simple Map(Reduce)•Good administration•Free basic usage
GAE
Thursday, April 28, 2011
![Page 6: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/6.jpg)
•Context and Dependency Injection•JSR-299 → JBoss Weld RI•“type-safe” programming•“contexts” concept•Easy to extend: “Extensions”•“CDI extension n00b ...” up next
CDI
Thursday, April 28, 2011
![Page 7: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/7.jpg)
•Simple reason: sandbox app•Android app with server back-end•Tattletale (Tožibaba)
•Zero administration / configuration•Reliable up-time•No more “boiler-plate” code → CDI
Why GAE and CDI?
Thursday, April 28, 2011
![Page 8: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/8.jpg)
•@Inject•@Qualifier•@Named•@Scope•Interceptors•InjectionPoint•Instance•@Produces
•@Observes•@ConversationS.•@Decorator•@Alternative•@Sterotype
•Catch @Any CDI session!
CDI #2
Thursday, April 28, 2011
![Page 9: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/9.jpg)
•JPA•JSF2•BeanValidation•javax.cache•JSON•ShrinkWrap + Arquillian
Other technologies
Thursday, April 28, 2011
![Page 10: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/10.jpg)
•Know (all) restrictions!•30sec, white-list, no threads, ...
•How portable should my app be?•Development vs. Production Env!•Frameworks have problems•But they mostly have (easy) solutions → fork?
Project Kick-Off
Thursday, April 28, 2011
![Page 11: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/11.jpg)
•Abstract away GAE API•Pure JavaEE•Port app to JBossAS (6 & 7)
•Use CDI as much as possible•Test it all, same as other JavaEE apps
The Goal
Thursday, April 28, 2011
![Page 12: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/12.jpg)
•CDI•“Entry” mechanism•Request / response binding•Lack of “lifecycle” handling
Bean
ProxyInitial problems
Thursday, April 28, 2011
![Page 13: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/13.jpg)
•JPA•Limited relationships (Entity groups)•Proxying layer vs. Custom “ORM”
•Transaction per “Entity group”•Old DataNucleus version•Long vs. Key entity key•“Enhanced” entities•GeoModel hashing queries (“IN”)
Initial problems
Thursday, April 28, 2011
![Page 14: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/14.jpg)
•JSF2•Context parameter settings•“new InitialContext” patch•“built-in” EL 1.0 → workaround
Initial problems
Thursday, April 28, 2011
![Page 15: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/15.jpg)
•BeanValidation•Static usage with JPA•Size•Configuration
Initial problems
Thursday, April 28, 2011
![Page 16: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/16.jpg)
•javax.cache (GCache)•No partition•NUCCORE-540 → fork
•JSON•Different versions; client vs. server
•Arquillian•Missing GAE container
Initial problems
Thursday, April 28, 2011
![Page 17: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/17.jpg)
•CDI•“Bean scanning” → exact listing•“Lazy beans” → MVC re-write•GZIP + Base64 usage•“Fall-back / repeat” mechanism
“Production” problems
Thursday, April 28, 2011
![Page 18: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/18.jpg)
•JPA•Explicit entity listing•Maximize cache usage•“Caching” → Lazy EMF
•javax.cache•serialVersionUID•Non-primitive variables•Cache evict / clear mechanism
“Production” problems
Thursday, April 28, 2011
![Page 19: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/19.jpg)
•ShrinkWrap•Binaries abstraction
•Arquillian•Runtime / Env abstraction•https://github.com/alesj/arquillian
Testing
Thursday, April 28, 2011
![Page 20: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/20.jpg)
•Lhotse POC•https://github.com/alesj/lhotse
Server-API
Server-JEEServer-GAE
Tattletale
Lhotse
Tattletale
Thursday, April 28, 2011
![Page 21: Thursday, April 28, 2011 · •Testing •Q & A Agenda Thursday, April 28, 2011 ... •Test it all, same as other JavaEE apps The Goal Thursday, April 28, 2011 •CDI •“Entry”](https://reader036.vdocuments.us/reader036/viewer/2022071022/5fd61bd98f91d858091084de/html5/thumbnails/21.jpg)
•Integrated & tested•GAE•JBossAS v6 & v7•GlassFish 3.1
•Important differences•Libraries usage
•Configuration ➚•Bugs, ...
•@Entity on @MappedSuperclass•Enhanced entities + JDO
Lhotse POC
Thursday, April 28, 2011