Modular Java EE in the cloud                          ng java EE a nd OSGi  rac tical guid e to mixiAp
Bert ErtmanFellow at Luminis in the NetherlandsJUG Leader for NLJUG and a Java Champion    @bertertmanPaul BakkerArchitect...
TrendApplications tend to grow bigger andmore complexAgile development and refactoringhave become more common
Th is leads to a number of challenges :           D ependency               Versioning           Man  agement            M...
Apps are moving to the cloudCloud challenges require non-trivial non-functionalrequirements   Zero-downtime deployments   ...
Modularity    is the answer
But... what exactly is    modularity?
What we learned about OO design in university :                 Promote                 cohesion     Prevent     (tight)  ...
How to preventcoupling in a code      base?
How to preventcoupling in a code      base?          interfaces
But how to make   sure nobodyaccidentally uses implementation     classes?
But how to makeimp lemen tation    sure nobody accidentally uses   hi  implemdi tation          en ng      classes?
Modules
Ok, but how to create an instance of a hidden         class?               MyInterface myI = new                MyImplemen...
Service Lookups
Design time      modularityDivide and conquerForces separation of concernsPrevents spaghetti
The jar file is the unit ofruntime modularity   on the Java platform                     What about                      c...
How to deal with   Runtime dynamics   Module versioning   Updating single modules     Intra-module dependency     management
Runtime                                     Architectural                      design                          dynamicWhat...
OSGi != modularityOSGi is the de-facto standard module  system for Java   What about Jigsaw?
OSGi != modularityOSGi is the de-facto         remember!                            Modularity is standard module         ...
OSGi != modularityOSGi is the de-facto         remember!                            Modularity is standard module         ...
Demo
OSGi vs. Java EE
OSGi vs. Java EE : opposite ends? Java EE:high level   APIs                                           OSGi:               ...
OSGi vs. Java EE : opposite ends? Java EE:high level   APIs                     They don’t                      have to be...
How? - 3 options                     #2#1                                    #3  O SG   i as core   Hybrid solutionarc hit...
Option 1 - OSGi in Java EE App Servers                                             use app server                         ...
Web Application Bundle (WAB)Enterprise  OSGi                                 Easystandard                           regist...
Web Application Bundle (WAB)                               manifest.mf mywab.jarMETA-INF/manifest.mf           Bundle-Name...
EJB Bundles                          Not a standard yet!Use transactionsand JPA like you                   Publish EJBsnor...
EJB Bundles              manifest.mf              Bundle-Name:              agenda.storage.ejb              Export-EJB: ALL
OSGi CDI integrationRFP 146                 Prototyped in                    WELD      Use CDI       within               ...
How are the app servers doing?             Deploy                  EJB/JPAApp server             WAB support             b...
Option 2 : Hybrid solution             Best of both worlds?      Your app is effectively split into two parts:        ‘Adm...
Example
Option 3 - OSGi a la carte                  Demo
What aboutdeployment?
What aboutdeployment?       Apache          Ace       - demo -
Apache ACE
Wrap up
What have we learned?You’ve seen the future of enterpris                                    e development ;-)Why modularit...
Want to try this yourself?Tomorrow 9.30 amHands-on Lab:  Building Modular Enterprise ApplicationsRoom: BOF 2
Recommended reading
Clou d provisioning         Cloud OSGi services    Bert Ertmanhttp://ace .apache.org/   http://www.amdatu.org/   bert.ertm...
Q&A
Modular Java EE in the Cloud
Upcoming SlideShare
Loading in …5
×

Modular Java EE in the Cloud

2,476 views

Published on

Java EE 6 is an awesome platform, but how do you design a system that can evolve for many years in production? And how do we run this stuff in the cloud?

Designing a system that can evolve without creating a maintenance nightmare is far from trivial. A service oriented, modular architecture will help a lot to replace parts of a system without breaking others. The only mature modularity approach for Java is OSGi - a framework that enables low-level modularity and services, but you still need APIs to create web applications, use transactions, access data sources etc. Without these APIs you will have a hard time building applications. Unfortunately OSGi and Java EE did not interoperate well in the past; But what if we want modularity in our architecture but also the ease-of-use of Java EE 6?

In this university you will:

1. Understand the benefits of a modular code base
2. Learn how to mix OSGi and Java EE
3. Manage modular cloud deployments using Apache ACE

..and of course there will be lots of live coding!

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
2,476
On SlideShare
0
From Embeds
0
Number of Embeds
37
Actions
Shares
0
Downloads
39
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

Modular Java EE in the Cloud

  1. 1. Modular Java EE in the cloud ng java EE a nd OSGi rac tical guid e to mixiAp
  2. 2. Bert ErtmanFellow at Luminis in the NetherlandsJUG Leader for NLJUG and a Java Champion @bertertmanPaul BakkerArchitect at Luminis Technologies @pbakker A presentation for
  3. 3. TrendApplications tend to grow bigger andmore complexAgile development and refactoringhave become more common
  4. 4. Th is leads to a number of challenges : D ependency Versioning Man agement Maintenance Deployment (long term)
  5. 5. Apps are moving to the cloudCloud challenges require non-trivial non-functionalrequirements Zero-downtime deployments Modular deployments Customer specific extensions (SaaS)
  6. 6. Modularity is the answer
  7. 7. But... what exactly is modularity?
  8. 8. What we learned about OO design in university : Promote cohesion Prevent (tight) cohesion coupling coupling
  9. 9. How to preventcoupling in a code base?
  10. 10. How to preventcoupling in a code base? interfaces
  11. 11. But how to make sure nobodyaccidentally uses implementation classes?
  12. 12. But how to makeimp lemen tation sure nobody accidentally uses hi implemdi tation en ng classes?
  13. 13. Modules
  14. 14. Ok, but how to create an instance of a hidden class? MyInterface myI = new MyImplementation();
  15. 15. Service Lookups
  16. 16. Design time modularityDivide and conquerForces separation of concernsPrevents spaghetti
  17. 17. The jar file is the unit ofruntime modularity on the Java platform What about classpath hell?
  18. 18. How to deal with Runtime dynamics Module versioning Updating single modules Intra-module dependency management
  19. 19. Runtime Architectural design dynamicWhat do we need? focus on equences module cons modularity framework let’s not High-level Right now, reinvent the enterprise APIs OSGi is the wheel only option
  20. 20. OSGi != modularityOSGi is the de-facto standard module system for Java What about Jigsaw?
  21. 21. OSGi != modularityOSGi is the de-facto remember! Modularity is standard module an architectural principle system for Java What about Jigsaw?
  22. 22. OSGi != modularityOSGi is the de-facto remember! Modularity is standard module an architectural principle system for Java Modularity does not come for free with a What about Jigsaw? framework
  23. 23. Demo
  24. 24. OSGi vs. Java EE
  25. 25. OSGi vs. Java EE : opposite ends? Java EE:high level APIs OSGi: low-level, mix and match yourself
  26. 26. OSGi vs. Java EE : opposite ends? Java EE:high level APIs They don’t have to be either / or OSGi: low-level, mix and match yourself
  27. 27. How? - 3 options #2#1 #3 O SG i as core Hybrid solutionarc hit ecture with using an Is publishe d injection bridge OSGi a la carteEE AP as services
  28. 28. Option 1 - OSGi in Java EE App Servers use app server capabilities likeOSGi bundles as clustering, data sources, etc. your core prog ramming Java EE APIs model available from within bundles the (near) future!
  29. 29. Web Application Bundle (WAB)Enterprise OSGi Easystandard registration of Servlets and JAX-RS WAR with a components manifest
  30. 30. Web Application Bundle (WAB) manifest.mf mywab.jarMETA-INF/manifest.mf Bundle-Name: agenda.web.uiindex.html Web-ContextPath: /mywebWEB-INF/classes/ Import-Package: javax.servletMyResource.classWEB-INF/faces-config.xmlWEB-INF/web.xml/myweb/index.html/myweb/agenda
  31. 31. EJB Bundles Not a standard yet!Use transactionsand JPA like you Publish EJBsnormally would as OSGi services
  32. 32. EJB Bundles manifest.mf Bundle-Name: agenda.storage.ejb Export-EJB: ALL
  33. 33. OSGi CDI integrationRFP 146 Prototyped in WELD Use CDI within Use CDI to bundles produce / consume services
  34. 34. How are the app servers doing? Deploy EJB/JPAApp server WAB support bundles support GlassfishWebSphereWebLogic JBoss AS
  35. 35. Option 2 : Hybrid solution Best of both worlds? Your app is effectively split into two parts: ‘Adminstrative’ enterprise part -> Java EE ‘Dynamic’ part where services can be replaced without downtime -> OSGi Glue the two together using an ‘injection bridge’
  36. 36. Example
  37. 37. Option 3 - OSGi a la carte Demo
  38. 38. What aboutdeployment?
  39. 39. What aboutdeployment? Apache Ace - demo -
  40. 40. Apache ACE
  41. 41. Wrap up
  42. 42. What have we learned?You’ve seen the future of enterpris e development ;-)Why modularity is important (in the cloud)Practical solution for doing modu larity now
  43. 43. Want to try this yourself?Tomorrow 9.30 amHands-on Lab: Building Modular Enterprise ApplicationsRoom: BOF 2
  44. 44. Recommended reading
  45. 45. Clou d provisioning Cloud OSGi services Bert Ertmanhttp://ace .apache.org/ http://www.amdatu.org/ bert.ertman@luminis.eu @BertErtman AmdatuEclipse OSGi plugin That’s us Paul Bakkerhttp://bndtools.org/ http://luminis.eu/ paul.bakker@luminis.eu @pbakker
  46. 46. Q&A

×