Your SlideShare is downloading. ×
0
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Developer Productivity with Forge, Java EE 6 and Arquillian
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Developer Productivity with Forge, Java EE 6 and Arquillian

2,662

Published on

Presentation given at JavaOne Tokyo 2012 about the innovations in Java EE 6, JBoss Forge, Arquillian.

Presentation given at JavaOne Tokyo 2012 about the innovations in Java EE 6, JBoss Forge, Arquillian.

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

No Downloads
Views
Total Views
2,662
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
66
Comments
0
Likes
3
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. RAPID JAVA Using APPLICATION JBoss Forge, Arquillian & Java EE 6DEVELOPMENT Ray Ploski Director, Developer Programs & Strategy JBoss, by Red Hat, Inc.
  • 2. DEVELOPER PRODUCTIVITY - WHAT IF? Faster Start-Up Times 80% Less Configuration ? 50% Less Code Open eco-system 25% Less Classes Vendor Agnostic Rapid Application Tooling Easier Integration Testing * Based on a Sample POJO/JPA/REST Based Application
  • 3. GREAT !!!
  • 4. J2EE #fail #fail EJB #fail
  • 5. PURPOSE OF THIS TALK¡  Demonstrate productivity gains §  Less Code, Classes and Configuration¡  Address Concerns §  About Java EE, EJBs, App Servers & Lock-in¡  Introduce new innovations §  JBoss Forge §  CDI and Apache DeltaSpike §  Arquillian
  • 6. J2EE 1.4
  • 7. EJB 2.X SESSION BEAN
  • 8. EJB 2.X DEPLOYMENT DESCRIPTOR<!-- … à!<enterprise-beans>! <session>! <display-name>BankSB</display-name>! <ejb-name>BankBean</ejb-name>! <local-home>com.advocacy.legacy.ejb.BankLocalHome</local-home>! <local>com.advocacy.legacy.ejb.BankLocal</local>! <ejb-class>com.advocacy.legacy.ejb.BankBean</ejb-class>! <session-type>Stateless</session-type>! <transaction-type>Container</transaction-type>! </session>!</enterprise-beans>!<assembly-descriptor>! <container-transaction>! <method>! <ejb-name>BankSB</ejb-name>! <method-name>*</method-name>! </container-transaction>!</assembly-descriptor>!
  • 9. EJB 2.X CLIENT VIEWtry {!! Context ctx = new InitialContext();! BankLocalHome home = (BankLocalHome) !ctx.lookup(“java:comp/env/ejb/bank”);! BankLocal bank = home.create();! bank.deposit(2500.00, new Account(12345)); !} catch (Exception ex) {!! // …!}!
  • 10. J2EE #fail #fail EJB #fail
  • 11. DEVELOPER PRODUCTIVITY WHAT IF? Faster Start-Up Times 80% Less Configuration ? 50% Less Code Open eco-system 25% Less Classes Vendor Agnostic Rapid Application Tooling Easier Integration Testing * Based on a Sample POJO/JPA/REST Based Application
  • 12. JAVA EE 5¡ R esource injection in JEE5 §  @EJB, @Resource, @PersistenceContext, §  @PersistenceUnit¡ I nto Container Components: § Servlets, JSF backing beans and other EJBs¡ P rogress but still Problems §  No POJOs §  Cannot inject DAOs or helper classes that were not written as EJBs §  Hard to integrate anything but strictly business components
  • 13. Java EE 6
  • 14. EJB 3.1 SESSION BEAN OPTIONAL!
  • 15. JAVA EE 6 DEPLOYMENT DESCRIPTOR
  • 16. EJB 3.1 CLIENT VIEW@EJB BankLocal bank;!!public void makeDeposit() !{! bank.deposit(2500.00, new Account(12345));!}!
  • 17. HOW DID THEY DO THAT?¡ C onfiguration by exception with sensible defaults §  Security permissions defaults to UNCHECKED §  Transaction type defaults to CONTAINER §  Transaction attribute defaults to REQUIRED¡ U se Annotations §  To choose explicitly (recommended) §  To override defaults¡ D eployment descriptor is no longer required §  But can override above configurations
  • 18. EASE-OF-USE IMPROVEMENTS¡  Optional Local Interface¡  Simplified Packaging¡  EJB-Lite¡  Portable JNDI Naming¡  Simple Component Testing
  • 19. Loose CouplingSTRONG TYPING
  • 20. DEPENDENCY INJECTION IN TWO PARTSDI (@Inject) CDIJSR 330 JSR 299javax.inject! javax.enterprise.context! ! Alternatives!@Inject! Producers!@Named! Scopes!@Singleton! Stereotypes!@Qualifier! Decorators!@Scope! Extensions!
  • 21. INJECTION 101public class StatusUpdater {!! @Inject! private UrlShortener shortener;!! public void post (String username, String status) {! !String sStatus = shortener.shortenUrls(status);! !System.out.println(username + “ said “ + sStatus);! }!!}! !
  • 22. WHAT MAKES CDI UNIQUE? STANDARD TYPE SAFEEXTENSIBLE
  • 23. QUALIFIED INJECTION OF RESOURCES@Path(“/items”) @ManagedBean! Strong Typingpublic class ItemRestService {! No Strings! @Inject @NumberOfDigits(Digits.EIGHT)! private NumberGenerator numberGenerator;! …!}!!!@WebServlet(urlPatterns = “/itemServlet”)!public class ItemServlet extends HttpServlet {!! @Inject @NumberOfDigits(Digits.THIRTEEN)! private NumberGenerator numberGenerator;! …! Loose Coupling}! No Reference to Implementation
  • 24. DEFINING THE QUALIFIER!@Qualifier!@Retention(RUNTIME)!@Target({FIELD, TYPE, METHOD, PARAMETER})!public @interface NumberOfDigits {!! !Digits value();!!}!!public enum Digits {! !TWO, EIGHT, TEN, THIRTEEN!!}!!
  • 25. DEFINING THE BEANS@NumberOfDigits(Digits.EIGHT)!public class IssnGenerator implements NumberGenerator {!! public String generateNumber() {! return “8-” + nextNumber();! }!! // …!}!!@NumberOfDigits(Digits.THIRTEEN)!public class IsbnGenerator implements NumberGenerator {!! public String generateNumber() {! return “13-84356-” + nextNumber();! }!! // …!}!
  • 26. CDI - EXTENSIBLE BY DESIGN¡ M any community projects of extensions: § Seam 3, CODI, Cambridge Technology Partners¡ These multiple projects merging to deliver a vendor-neutral open ecosystem for extensions named DeltaSpike .¡  Hosted on Apache. Works on all Java EE 6 servers + + CDISource DeltaSpike
  • 27. Servlet Container vs. Java EE6 (After lots of tweaking)
  • 28. DEVELOPER PRODUCTIVIT Y - WHAT IF? Faster Start-Up Times 80% Less Configuration ? 50% Less Code Open eco-system 25% Less Classes Vendor Agnostic Rapid Application Tooling Easier Integration Testing * Based on a Sample POJO/JPA/REST Based Application
  • 29. ISN’T JAVA EE TOO SLOW & FAT?¡  Startup Times w/ an Application Deployed §  JBoss AS 7.10 ~ 2 seconds §  GlassFish v3 ~ 4 seconds §  Tomcat 6 + Spring ~ 4 seconds § Java EE 6 War File < 100kb
  • 30. MEMORY COMPARISON
  • 31. JAVA EE 5
  • 32. JAVA EE 6
  • 33. JAVA EE 6 SPECIFICATION No Where in the Specification does it mention thatApp Servers must be slow and complex.
  • 34. DEVELOPER PRODUCTIVIT Y - WHAT IF? 80% Less Configuration Faster Start-Up Times ? Open eco-system 50% Less Code 25% Less Classes Vendor Agnostic Rapid Application Tooling Easier Integration Testing * Based on a Sample POJO/JPA/REST Based Application
  • 35. Start up CostsGotchasIntegration Details
  • 36. I need one ofthose widgets for a marketing T YPICAL DEVELOPER meeting in an hour. NIGHTMARE
  • 37. CARVE OUT A PROJECTWORK IT INTO SHAPE
  • 38. Let’s get started
  • 39. JAVA EE IN MINUTES
  • 40. FORGE LEVERAGES FACETS & PLUGINS Project Java Facet Web Facet X Facet Plugin A Plugin B ... Plugin X
  • 41. Demonstration of Forgeand Java EE Application
  • 42. GETS YOU STARTEDHandles details, gives you perspective QUICKLY … and time HANDLES “GOTCHAS” ADDS & ACTIVATES TECH VIA PLUGINS
  • 43. TESTING JAVA EE USED TO BE DIFFICULT
  • 44. MANY STEPS REQUIRED FOR MODIFYING CODE PRODUCTIVELY
  • 45. ARQUILLIAN REMOVES THE STEPS
  • 46. ARQUILLIAN
  • 47. ARQUILLIAN REMOVES THE STEPS SEE MORE AT コンテナでテストをまわせ!
  • 48. A powerful programming model. Less code, greater portability.Optimized for productivity & automation. CDI and Forge plugins.Absolutely. You saw it first hand.
  • 49. ¡  Max Andersen §  “See Context & Dependency Injection from Java EE 6 in Action” §  http://www.slideshare.net/maxandersen/see-context- dependency-injection-from-java-ee-6-in-action¡  Pete Muir REFERENCES §  “CDI in Action”¡ Andrew Lee Rubinger §  “The Death of Slow” §  http://www.slideshare.net/ALRubinger/devoxx-2011- jboss-as7-death-of-the-slow¡ B ert Ertman §  EJB 3.1 §  http://www.slideshare.net/stephanj/ejb-31-by-bert- ertman¡  Antonio Goncalves §  “To inject or not to inject: CDI is the question” §  http://www.slideshare.net/agoncal/to-inject-or-not-to-inject-cdi-is-the- question

×