qcon sp
play

QCon SP Java EE: Extendable and Functional David Blevins - PowerPoint PPT Presentation

QCon SP Java EE: Extendable and Functional David Blevins Tomitribe #JavaEE @dblevins @tomitribe QCon SP Talk Overview Part 1: Extensibility CDI Scopes Connectors Java EE 6-7 Part 2: Functions New API Opportunities


  1. QCon SP Java EE: Extendable and Functional David Blevins Tomitribe #JavaEE @dblevins @tomitribe

  2. QCon SP Talk Overview • Part 1: Extensibility • CDI Scopes • Connectors • Java EE 6-7 • Part 2: Functions • New API Opportunities with Java 8 • Killing annotations • Shift from Declarative to Programmatic • Java EE 8? #JavaEE @dblevins @tomitribe

  3. QCon SP Part 1: Extendable CDI Scopes #JavaEE @dblevins @tomitribe

  4. QCon SP Background • EJB and CDI Alignment • EJB slowly being deprecated • Functionality moving to CDI • CDI significantly more extendable #JavaEE @dblevins @tomitribe

  5. QCon SP CDI and EJB Under the Covers #JavaEE @dblevins @tomitribe

  6. CDI 1.0 EJB 3.1 QCon SP Proxy Proxy (Fake) (Fake) (Context/Scope) (Pool) 1. Resolution 1. Resolution Security Transaction 2. Services 2. Services Interceptors Interceptors Decorators Decorators Instance Instance 3. Invocation 3. Invocation (Real) (Real) #JavaEE @dblevins @tomitribe

  7. CDI 1.1 EJB 3.2 QCon SP Proxy Proxy (Fake) (Fake) (Context/Scope) (Pool) 1. Resolution 1. Resolution Security Transaction Transaction 2. Services 2. Services Interceptors Interceptors Decorators Decorators Instance Instance 3. Invocation 3. Invocation (Real) (Real) #JavaEE @dblevins @tomitribe

  8. QCon SP EJB/CDI Lifecycle Lineup • @Singleton • same as CDI @ApplicationScoped • @Stateful • applies to any CDI Scope, not just @SessionScoped • @Stateless • no CDI equivalent • @RequestScoped sort of close(ish) #JavaEE @dblevins @tomitribe

  9. QCon SP Implementing a Scope • Create a new Scope Annotation • Create an implementation of Context • Register the Scope and Context via an Extension • Mark the boundaries • Logical concept • Always different #JavaEE @dblevins @tomitribe

  10. QCon SP Custom Scope Examples #JavaEE @dblevins @tomitribe

  11. QCon SP http://tomitribe.io/projects/ microscoped #JavaEE @dblevins @tomitribe

  12. QCon SP Common Mistakes you will make • Not putting a beans.xml in your app (Java EE 6) • No CDI for you! • Not understanding @Typed • Psst, think @Local from EJB • Bites you when using @Produces • Not understanding what Dependent and NormalScope • Dependent == plain object • NormalScoped == proxied object • Bites you when creating custom scopes #JavaEE @dblevins @tomitribe

  13. QCon SP Part 1: Extendable Connectors #JavaEE @dblevins @tomitribe

  14. QCon SP Inbound Connectors (aka MDBs) #JavaEE @dblevins @tomitribe

  15. QCon SP The following are all false • MDBs are for JMS • MDBs must be asynchronous • A MessageListener interface has one method which returns ‘void’ • MDBs are always pooled • MDBs are stateless #JavaEE @dblevins @tomitribe

  16. QCon SP JMS MDB in Java EE 7 #JavaEE @dblevins @tomitribe

  17. QCon SP Title Text • Body Level One • Body Level Two • Body Level Three • Body Level Four • Body Level Five #JavaEE @dblevins @tomitribe

  18. QCon SP Title Text • Body Level One • Body Level Two • Body Level Three • Body Level Four • Body Level Five Bad Configuration #JavaEE @dblevins @tomitribe

  19. QCon SP Title Text • Body Level One • Body Level Two • Body Level Three • Body Level Four • Body Level Five Boiler Plate #JavaEE @dblevins @tomitribe

  20. QCon SP Title Text • Body Level One • Body Level Two • Body Level Three • Body Level Four • Body Level Five Only Useful Line of Code #JavaEE @dblevins @tomitribe

  21. QCon SP JMS MDB in Java EE 8 #JavaEE @dblevins @tomitribe

  22. QCon SP Oh yeah. #JavaEE @dblevins @tomitribe

  23. QCon SP Custom Connector Examples #JavaEE @dblevins @tomitribe

  24. QCon SP https://tomitribe.io/projects/ chatterbox https://tomitribe.io/projects/ sheldon #JavaEE @dblevins @tomitribe

  25. QCon SP Part 2: Functional (Ideas for the Future) #JavaEE @dblevins @tomitribe

  26. QCon SP Eras of Java EE XML Annotation Lambda • 1998 (start) • 2006 (start) • 2014* (start) • 2001 (strong) • 2009 (strong) • ???? (strong) #JavaEE @dblevins @tomitribe

  27. QCon SP Opportunity for Impact • From Declarative to Programmatic • From Component-side to Caller-side • Large decrease in annotation and class overhead • Logic is mobile Impact of Opportunity • Potential Growth in mixed container and “API” code • Lifecycle compromises might need to be made • Will take time and effort (join in!) #JavaEE @dblevins @tomitribe

  28. QCon SP Thank You! #JavaEE @dblevins @tomitribe

Recommend


More recommend