Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Modern, lightweight development with Java EE 6


Published on

Published in: Technology
  • Be the first to comment

Modern, lightweight development with Java EE 6

  1. 1. <Insert Picture Here>Modern, Lightweight Development and Java EE 6Alexis Moussine-Pouchkine, @alexismp ©2011 Oracle Corporation
  2. 2. The following is intended to outline our general product direction. It is intended for information purposes only, and may not be incorporated into any contract. It is not a commitment to deliver any material, code, or functionality, and should not be relied upon in making purchasing decisions. The development, release, and timing of any features or functionality described for Oracle’s products remains at the sole discretion of Oracle.©2011 Oracle Corporation 2
  3. 3. Terminology •  What does “Modern” Development mean? •  The obvious: leveraging recent innovation •  Balancing of cutting and bleeding edge •  Simpler, easier to use •  What does “Lightweight” Development mean? •  What you want, not more than what you want •  Smaller runtime memory footprint •  Easy install and download •  Less deployment unit / library bloat •  Decoupling container – application dependencies©2011 Oracle Corporation 3
  4. 4. Modern and Lightweight is not enough •  Choice –  Your tool selection, your dev/test environment, your persistence provider •  Productivity –  IDEs (or not), lots of OSS Libraries / Frameworks •  Familiarity –  Standard-based with extension points, not proprietary •  Simplicity –  Leaner, POJO driven API with annotations •  Quality –  Facilitate Agile and Test Driven Development •  Agility –  Server Modularity, Extensibility, Linked Portfolio©2011 Oracle Corporation 4
  5. 5. Java EE 6 meets and exceeds those requirements Embrace open source Web Profile Flexible, frameworks API Pruning Lightweight Extensible Injection Enables Drag & Drop framework installation Java EE Developer Productivity More annotations, better IDEs POJO development Less XML configuration©2011 Oracle Corporation
  6. 6. Java EE 7: Cloud Foundation•  Formalize new roles, PaaS, multi-tenancy•  Pluggable cloud services•  Revision of underlying Java EE specs
  7. 7. Agenda Modern, Lightweight approaches in Java EE6: !  Development Approach !  Developer Tools !  Build Environment, Continuous Integration !  Testing, Diagnostics, Tuning !  Modular Runtime Services !  Easier Web Application Packaging !  New Approaches to Persistence !  Conclusion©2011 Oracle Corporation
  8. 8. Use Lightweight, Testable Plain Old Java Objects •  Less configuration Presentation JSF2 Facelets complexity •  Easier testability and Dependency Injection Context JSR 330 alignment with OS tools Dependency & Injection Business Services –  Ant / Maven / Hudson EJB 3.1 •  Java EE 6 makes advances in this area Basic Managed Beans JAX-RS REST –  (CDI) Context and Component SOAP JAX-WS Dependency Injection –  EJB 3.1, JPA Persistence JPA 2 –  JSF 2.0 (Beans, etc) Caching –  Java EE will only In-memory grid continue to improve •  Caching with clusterable hashmaps becoming the norm©2011 Oracle Corporation
  9. 9. Developer Tools
  10. 10. NetBeans IDE•  A comprehensive, modular IDE >  First to support Java SE 7 >  Best-in-Class support for Java EE 6 >  GlassFish 3.1.1 support, WebLogic 10.3.4 >  Extensive dynamic language support (PHP, Ruby, Groovy, etc.) >  Connected Developer improvements >  Intuitive workflow, Java FX, Swing, C++ >  Debugger, Profiler, Refactoring, etc.•  A platform for building applications >  RCP = Rich Client Platform >  Modular architecture allows easy reuse >  Rich framework of windows, menus, tool bars, actions•  A thriving open source community >  Large set of 3rd party plug-ins >  Over 20 Million Downloads >  Over 100 Partner Companies >  Active blogging community©2011 Oracle Corporation
  11. 11. Oracle Enterprise Pack for Eclipse Free Eclipse Plug-ins for Fusion MiddlewareJava / Java EE / ADF AppXRay™ WebLogic, GlassFish Artifact ADF HTML CSS JSF JSP TLD Faces Presentation Oracle Coherence Spring, ORM, DB, JPA Java Resource Faces XML POJO Variable bundles Config schema Component Eclipse EJB 3 Spring POJO Link JPA DAO Data Access External Resources©2011 Oracle Corporation 12
  12. 12. IntelliJ IDEA •  Excellent Multi Language Support –  Java 7, JavaScript, Ruby, Groovy, HTML, CSS, XML –  Recognizes languages inside of other languages •  Strong Refactoring, Source Editing •  Very current support of 3rd party technology –  Maven, Groovy, Spring, Flex, Android, Ruby, Python, Scala, PHP •  Great for Java •  May not be the best for Java EE, relative to other options –  GlassFish / WebLogic Server plug-ins are tricky –  Comparatively less Java EE wizards –  No EE javadoc code completion in the editor©2011 Oracle Corporation
  13. 13. Text Editors (VI, Emacs, VIM, UltraEdit, etc) •  Editors were always lightweight, but perhaps not modern +/- No IDE project model to conform to + Good for any programming language (usually) + Doesn’t even show up on corporate architecture radar - No integrated debugging, wizards, validation - Search and replace ≠ refactoring, D-I-Y codegen - Potentially lots of ongoing work to configure©2011 Oracle Corporation
  14. 14. Build Environment,Continuous Integration
  15. 15. F/OSS Java tools ecosystem Leverage free and open source software Dependency Management Tools Hudson Continuous Automation Integration Tools Tools WebLogic GlassFish Tracking Testing Tools Version Control Tools©2011 Oracle Corporation 16
  16. 16. Maven, if you can Build and Dependency Management •  Maven wants to control everything, including directory structure •  If your project can work with the constraints, Maven will: •  Enable repeatable builds •  Embed build knowledge into the project •  Make it possible to create automated builds •  Enable CI •  Can enforce uniform project setup •  No need to have all developers script their own build.xml files •  No duplication of build code •  Simplify dependency management •  A lot of plug-ins available©2011 Oracle Corporation
  17. 17. Maven with WebLogic and GlassFish WebLogic GlassFish •  wls:install* •  glassfish:create-domain •  wls:create-domain* •  glassfish:start-domain •  wls:start-server* •  glassfish:deploy •  wls:deploy •  glassfish:redeploy •  wls:undeploy •  glassfish:undeploy •  wls:re-deploy •  glassfish:stop-domain •  wls:start-app •  glassfish:delete-domain •  wls:list-apps •  wls:stop-app •  wls:wlst (run script) Maven •  wls:stop-server* Repo URI * Coming in Java EE 6 Release©2011 Oracle Corporation
  18. 18. An agile imperative: Hudson CI Continuous integration •  Written in Java, has IDE plug-ins •  Works on any Java container •  No install required, java –jar hudson.war! •  Easy to use, browser based config •  REST API and CLI •  Vibrant Ecosystem of 330+ plug-ins –  GlassFish Plug-in –  Coming soon: WebLogic Plug-in •  How it works: –  Dev commits – which triggers a build –  Hudson detects changes, checks out code –  Builds project on another machine –  Organizes Build Output (libs, docs, installers) –  Records and Publishes results –  Feedback – only when necessary©2011 Oracle Corporation
  19. 19. Testing, Diagnostics, Tuning
  20. 20. Test Driven Development •  Small steps •  Frequent check-ins •  Design for Commit updates refactor testability •  Interface first, then Add test implement Make small change •  Mock objects Commit updates©2011 Oracle Corporation
  21. 21. Lots of F/OSS to leverage when in development Category Tool Continuous Integration Hudson/Jenkins, CruiseControl, Continuum Acceptance FitNesse, Selenium Load Test JMeter, Eclipse TPTP Coverage Cobertura, Emma U N Web Apps Selenium, HttpUnit I T Java EE Servers Cargo, Cactus, Arquillian T Database DBUnit E S Mock Objects jMock, EasyMock, Mockito T I Unit tests JUnit, TestNG N G Build Ant, Maven, Ivy Race/Deadlock JRockit Mission Control Profiling JRockit Mission Control, NetBeans Memory Leak JRockit Mission Control©2011 Oracle Corporation
  22. 22. Plug-in to leverage when in deployment: JRMC JRockit Mission Control and JRockit Flight Recorder Monitoring Profiling & performance tuning Deploy Development Operations Alerts & triggers Regression testing Production diagnostics Troubleshooting©2011 Oracle Corporation 23
  23. 23. JRockit Flight Recorder ”Black box” 1.  A serious failure occurs •  JVM crash •  Out of memory •  Application terminates unexpectedly Mission Control Server •  Hardware failure or power outage 2.  Buffered data is saved to a file •  Contents include both in-memory and on- disk buffer data •  Exception: HW failure will only yield on- disk data 3.  User opens file in JRMC for analysis In-memory/on-disk buffer©2011 Oracle Corporation 24
  24. 24. Flight Recorder ”Real-time Application Diagnostics”Mission Control Server 1.  Monitoring system detects an issue •  Too long JSP response time •  Unexpected memory growth •  (anything exposed through JMX) 2.  JRMC requests diagnostics data •  “Give me all diagnostics data leading up to the issue” In-memory/on-disk buffer 3.  Data is sent to JRMC •  Analyze immediately (manual or automatic) •  And/or store for later analysis
  25. 25. Flight Recorder Benefits •  Always available –  No need to instrument application –  No runtime overhead •  Dramatically decrease time & cost for troubleshooting –  Both in-house and when working with Oracle Support •  Enable positive feedback loop in production –  Collect data from all SLA breaches –  Analyze, fix, update application, repeat until no more errors •  Improved datacenter performance & availability
  26. 26. Modular Runtime Services
  27. 27. Rich Features in a Lightweight Runtime •  Pay for what you use –  Starts in seconds –  Features dynamically loaded as needed, like … •  … Administration console •  … EJB container, embedded JMS server •  … Web services container •  … Clustering •  Standard distributions of Java EE Servers becoming the norm –  Java EE 6 Web Profile –  Full Java EE 6 –  Minimize runtime to avoid the need to build custom platform©2011 Oracle Corporation
  28. 28. Java EE Server Modularity Application Container Kernel Container Runtime Deployment Configuration Container SDK NIO Monitoring AdminGUI Application Container Runtime Approach Taken on WebLogic Server and GlassFish©2011 Oracle Corporation
  29. 29. What Does it Mean to Developers? •  Expect to see lighter weight distributions of Java EE Servers –  GlassFish Server Web Profile – 29M •  Expect to see runtime profiles –  WebLogic Server having runtime Web Profile support turning off EJB, JMS and JCA containers •  Expect to see experimentation with OSGi programming models –  GlassFish OSGi/Java EE Hybrid specifications and implementation •  e.g. JPA, EJB, JDBC, JTA, ... as OSGi services •  We need your feedback as to how important this is for Java EE 7 and 8 going forward©2010 Oracle Corporation 30
  30. 30. Easier Web Application Packaging
  31. 31. Simplified Packaging of Web Applications Web ApplicationWEB-INF/classes com/acme/MyServlet.class com/acme/MyFilter.classWEB-INF/lib someframework.jarWEB-INF/web.xmlindex.htmlmain.cssjquery-1.4.2.jsui/jquery.ui.core.jsui/jquery.ui.widget.js
  32. 32. Simplified Packaging of Web Applications Web ApplicationWEB-INF/classes @WebServlet(urlPatterns=”/foo”) public class MyServlet { … } com/acme/MyServlet.class com/acme/MyFilter.class @WebFilter(urlPatterns=”/foo”) WEB-INF/lib public class MyFilter { … } someframework.jarindex.htmlmain.cssjquery-1.4.2.jsui/jquery.ui.core.jsui/jquery.ui.widget.js
  33. 33. Simplified Packaging of Web Applications Web ApplicationWEB-INF/classes com/acme/MyServlet.class com/acme/MyFilter.class Framework JarWEB-INF/lib someframework.jar META-INF/web-fragment.xml com/fw/FwServlet.class com/fw/FwFilter.classindex.htmlmain.cssjquery-1.4.2.jsui/jquery.ui.core.jsui/jquery.ui.widget.js
  34. 34. Simplified Packaging of Web Applications Web ApplicationWEB-INF/classes com/acme/MyServlet.class com/acme/MyFilter.classWEB-INF/lib jQuery Resource Jar someframework.jar jquery-ui-1.8.4.jar META-INF/resources/jquery-1.4.2.js META-INF/resources/ui/jquery.ui.core.js META-INF/resources/ui/jquery.ui.widget.jsindex.htmlmain.css
  35. 35. Simplified Packaging of Web Applications Web ApplicationWEB-INF/classes com/acme/MyServlet.class com/acme/MyFilter.classWEB-INF/lib •  Self-contained someframework.jar •  Generic jquery-ui-1.8.4.jar •  Reusableindex.htmlmain.css
  36. 36. New approaches to persistence
  37. 37. New approaches to structured storage RDBMS In-memory Data NRDBMS Grids (noSQL) •  Ubiquitous •  Mature •  Newer, higher level •  Distributed storage, APIs •  Emerging processing, and caching •  Often distributed©2011 Oracle Corporation
  38. 38. A quick look at Java Persistence API 2.0 •  Why JPA and not other Java persistence methods? –  Incredible productivity gain using annotations –  Reduce errors from repetitive coding with lower level APIs –  Standard, not proprietary – many providers exist –  Integration point for in-memory data grid –  JPA 2.0’s ORM can handle real life database schemas •  JPA in a nutshell –  Concrete classes (POJOs) –  No required interfaces or inheritance –  new() for instance creation –  Mapping using annotations and/or XML –  “Managed” by an EntityManager –  Can leave the Container (“detached”)©2011 Oracle Corporation
  39. 39. A quick look at in-memory caching •  Why an in-memory data grid? –  For public internet scale –  For solid-state response times –  Processing large event volumes •  In-memory data grid in a nutshell –  Container-less Clustering of Java Processes –  Data Structures to manage Data across a Cluster / Grid –  Real-Time Event Observation – Listener Pattern –  Materialized Views of Data –  Parallel Queries and Aggregation – Object-based Queries –  Parallel Data Processing –  Parallel Grid Processing –  RemoteException Free Distributed Computing©2011 Oracle Corporation
  40. 40. A quick look at NRDBMS (a.k.a NoSQL) •  Why NRDBMS? –  indexing a large number of documents –  serving data intensive pages at commercial internet loads –  delivering streaming media –  when you can sacrifice data consistency for performance •  NRDBMS in a nutshell –  Document store, graph, key-value store, multivalue databases, OODBMS, Tabular, Tuple Store –  May not require fixed table schemas –  Usually avoid joins –  Scale horizontally©2011 Oracle Corporation
  41. 41. Conclusion
  42. 42. Conclusion: Java EE 6 is best for enterprise •  Enterprises need commercial support & services •  Commercial upgrade options abound •  Contractual Technical Support & ProServ •  Agile often means projects have unforeseen futures •  Having a linked commercial portfolio means you aren’t stuck in a point solution •  Enterprises need platforms with healthy ecosystems •  Java EE and open source are constantly inspiring each other, and should be considered together •  Java EE6 meets the requirements out of the box •  Together with F/OSS for testing, quality, troubleshooting •  Server extensibility means your investment will survive the: •  Next point solution •  Next cool language that is narrow in scope©2011 Oracle Corporation 43
  43. 43. <Insert Picture Here> ©2011 Oracle Corporation