Your SlideShare is downloading. ×
  • Like
  • Save
Java EE 6: What's New
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×

Now you can save presentations on your phone or tablet

Available for both IPhone and Android

Text the download link to your phone

Standard text messaging rates apply

Java EE 6: What's New

  • 2,567 views
Published

 

Published in Technology
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Be the first to comment
No Downloads

Views

Total Views
2,567
On SlideShare
0
From Embeds
0
Number of Embeds
1

Actions

Shares
Downloads
0
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
  • handles transactions, security, scalability, concurrency -> developers can concentrate on business logic JCP -> different vendors member Pick different implementations Compatible products. JSR, reference implementation and TCK TCK: The TCK is a set of tools and tests to verify that an implementation of the technology conforms to the specification Most stuff have been around, JEE stanrdizes them isntead of inventing them Some people argue that spec are too late … reestablish a common platform -> to grow the next wave of innovation.
  • flexibility: zero configuration, drag-and-drop design methodology Annotations rather than configuration
  • -deprecation attemp to make the platform smaller and cleaner APIs that are outdated, not well supported, or not widely deployed - JAX-RPC: superseded by JAX-WS since JEE 5 - EJB Entity Beans: replaced by JPA - JAXR: very limited adoption. - Java EE Application Deployment: no widely adopted
  • decoupling the specifications Modularity recognizes platform too big for specific tasks
  • Resing: web profile certified to be Web profile Subset of platform Package in a war file
  • -connecting application servers and enterprise information systems (EIS) as part of EAI (enterprise application integration) : Connection management, Transaction, Security, Message Flow
  • Large and small vendors? Commercial and Open source? Spring and Java EE are converging
  • Can be set in web.xml to check or not check for Annotations Searches in classes and all jar files in lib for annotations
  • - Problem: Web.xml tends to get big - Problem: Updates due to third party libs i.e. Wicket, SpringMVC
  • Streaming, long-polling
  • No xml config J2EE 1.4 were underspecified no vendor specific ejb configuration anymore Integration with Spring, Guice and others
  • EJB 2 was 8 years ago
  • - Container and bean-managed concurrency control: @Lock(READ) and @Lock(WRITE)
  • No need for JMS configuration Return void or Future No transaction propagation from caller to calleer. continues processing the invocation on a separate thread.
  • ejb specifications silent about jndi names. Vendors specific way.
  • Embeddable has been around, but standardized Vendors may choose to implement the full version
  • Solves typical enterprise java developer problems gone: complexity, coding nightmare Inappropriate comparison: spring is the whole stack, not only component model Out of the box transaction, security, etc services Out of the box support for JMS, Webservices, etc Pitchfork JEE6 is pool based objects vs. Spring is a singleton model
  • Introduced with JEE 5 Seperated from EJB Most configuration is defaulted, configure to overrride
  • Orphan Removal
  • Criteria API + Metamodel API = Strongly Typed Queries Advantages: Compile-time safety Code completion of attributes -Disadvantages: Meta-model needs to be manually or automatically generated
  • @ElementCollection -> separate table Persisting list order -> without being part of the bean Derived identifier: primary key of one table includes a foreign key to another
  • Not tied to any tier Consistent in all layers Validation metamodel API -> query the list of constraints on a given class or property.
  • - Decorator is bound to a specific interface and delegates to it
  • Everything Managed Bean -> with extra services if EJB or Web Services Managed beans -> POJO whose life-cycle is governed by the container
  • -@Inject comes from Guice, can be used in Spring beans.xml needed, can be empty @Resource is available (overlap)
  • A conversation truncated session with start and end points determined by the application as opposed to the session which is controlled by the browser, server and session timeout.
  • META-INF/beans.xml
  • producers decoupled from observers observers are completely decoupled from producers Transactional observers receive their event notifications during the before or after completion phase of the transaction

Transcript

  • 1. Java EE 6 What’s New Siamak Sadeghianfar [email_address]
  • 2. Agenda
    • Introduction to EE
    • What’s New
      • Overview
      • Servlet 3.0
      • Enterprise JavaBeans 3.1
      • Java Persistence API 2.0
      • Bean Validation 1.0
      • Context and Dependency Injection 1.0
      • JavaServer Faces 2.0
  • 3. Introduction to EE
    • Formerly known as J2EE
    • Stack of technologies
    • Standard-based
    • Defined by specifications (JSR)
    • Steered by users through JCP
    • Focused on distributed, portable , scalable, multi-tier server-side applications
  • 4. Introduction to EE
    • Standardized APIs leveraging best ideas from the community
    • Better for developers - one API to learn and use
    • Can choose between competing implementations
    • Vendor independence
  • 5. Introduction to EE
  • 6. Introduction to EE
  • 7. Agenda
    • Introduction to EE
    • What’s New
      • Overview
      • Servlet 3.0
      • Enterprise JavaBeans 3.1
      • Java Persistence API 2.0
      • Bean Validation 1.0
      • Context and Dependency Injection 1.0
      • JavaServer Faces 2.0
  • 8. Overview
    • Flexibility and lighter web applications in focus
    • Simplification of development and deployment
    • Improve extensibility:
      • Zero configuration
      • Drag-n-drop web frameworks
  • 9. Overview
    • Prunning
      • Optional in next release
      • Deleted in subsequent releases
    • Pruning list
      • JAX-RPC (JSR 101)
      • EJB Entity Beans
      • JAX-R (JSR 93)
      • Java EE Application Deployment (JSR-88)
  • 10. Overview
  • 11. Overview
    • Profiles
      • Decoupled specifications
      • Bundles of technologies
      • Target a specific application category
      • Vendors may implement several
      • First profile: Web Profile
  • 12. Overview
  • 13. Overview
  • 14. Overview
  • 15. Overview Full Java EE 6 Web Profile Profile X Profile Y
  • 16. Overview Web Full Dependency Injection 1.0 JMS 1.1 JavaMail 1.4 Connector 1.6 JAX-WS 2.2, JAX-RS 1.1 JAX-RPC 1.1, JAXB 2.2 JAXR 1.0 Java EE Management 1.1 Java EE Deployment 1.2 JACC 1.3 JASPIC 1.0 JSP Debugging 1.0 Web Services Metadata 2.0 SAAJ 1.3 Web Services 1.3 Web Full Servlet 3.0 JSP 2.2 Expression Language 2.2 Debugging Support for Other Languages JSTL 1.2 JSF 2.0 Common Annotations 1.1 EJB 3.1 Lite EJB 3.1 JTA 1.1 JPA 2.0 Bean Validation 1.0 Managed Beans 1.0 Interceptors 1.1 CDI 1.0
  • 17. Overview
    • Packaging simplified
    Java EE 5 Java EE 6
  • 18. Overview
    • Major improvements
      • Servlet 3.0
      • EJB 3.1
      • JPA 1.0
      • CDI 1.0
      • Bean Validation 1.0
      • JAX-RS 1.1
      • JSF 2.0
      • Java Connectors 1.6
  • 19. Overview
  • 20. Overview
    • Java EE 6
    • Lightweight profiles
    • Standard
    • Several vendors
    • Portability
    • CDI
    • EJB
    • Bound to app server
    • Less flexible
    • Distributed
    • Bean Validation
    • Spring
    • Lightweight
    • Proprietary
    • Vendor lock-in
    • Portability
    • Dependency Injection
    • Transaction management
    • Above app server
    • Fast reaction to trends
    • Abstractions
  • 21. Agenda
    • Introduction to EE
    • What’s New
      • Overview
      • Servlet 3.0
      • Enterprise JavaBeans 3.1
      • Java Persistence API 2.0
      • Bean Validation 1.0
      • Context and Dependency Injection 1.0
      • JavaServer Faces 2.0
  • 22. Servlet 3.0 – Annotations
  • 23. Servlet 3.0 – Web Fragments
  • 24. Servlet 3.0 – Web Fragments
    • Pieces of web.xml in multiple places
    • Increased modularity and pluggability
    • Web fragment is a logical segment of web.xml
    • Enables web frameworks to self-register to the web container
  • 25. Servlet 3.0 – Web Fragments web-app.war WEB-INF classes lib web.xml x.jar y.jar META-INF web-fragment.xml META-INF web-fragment.xml
  • 26. Servlet 3.0 – Async Processing
    • Asynchronous request processing for AJAX (Comet)
    • Prevents thread blocking
  • 27. Servlet 3.0 – Async Processing AJAX Comet
  • 28. Agenda
    • Introduction to EE
    • What’s New
      • Overview
      • Servlet 3.0
      • Enterprise JavaBeans 3.1
      • Java Persistence API 2.0
      • Bean Validation 1.0
      • Context and Dependency Injection 1.0
      • JavaServer Faces 2.0
  • 29. EJB 3.1
    • Distributed component architecture
    • Run in an EJB Container
    • Services provided
      • Concurrency
      • Transactions
      • Security
      • Distribution
      • Resource Pooling
      • Events
  • 30. EJB 3.1
    • Typically contain business logic
    • Types
      • Stateful Seasion Bean
      • Stateless Session Bean
      • Message Driven Bean
  • 31. EJB 3.1 - Myths
    • Heavyweight
    • Hard to test
    • Not portable
    • Not extensible
    • Too complex
    • Hard to integrate to web frameworks
  • 32. EJB 3.1- No-interface View
  • 33. EJB 3.1 - Singletons
  • 34. EJB 3.1 – Asynchronisity
  • 35. EJB 3.1- Simplified Packaging bidder.ear page1.jsp ejb.jar web.war ejb 1 ejb 2 page2.jsp bidder.war page1.jsp classes ejb 1 ejb 2 page2.jsp
  • 36. EJB 3.1- And More…
  • 37. EJB 3.1- Lite
    • Subset of features
    • Bootstrap on Java SE
    • Embeddable container
    • Statefull, Stateless and Singleton
    • Transaction and Security
    • Interceptors
  • 38. EJB 3.1- Lite EJB Lite EJB 3.1 Local Session Beans Declarative Security Transactions (CMT/BMT) Interceptors Security Message Driven Beans RMI/IIOP Interoperability and Remote View EJB 2.x Backwards Compatibility Timer Service Asynchronous
  • 39. EJB 3.1
    • Standard
    • Multiple implementations
    • Thread-safe
    • Robust remoting
    • Instance pooling
    • Seamless EE integration
    • Needs container
    • Tight JPA integration
    • Spring?
    • Choice of persistence
    • Templates
    • Vendor lock-in
    • No state management
  • 40. Agenda
    • Introduction to EE
    • What’s New
      • Overview
      • Servlet 3.0
      • Enterprise JavaBeans 3.1
      • Java Persistence API 2.0
      • Bean Validation 1.0
      • Context and Dependency Injection 1.0
      • JavaServer Facess 2.0
  • 41. JPA 2.0
    • Persistence framework
    • Generic object relational mapping
    • Annotation driven
    • Configuration by exception
    • Pluggable persistence provider
    • Runs within Java EE and SE
  • 42. JPA 2.0 JPA 1.0 Hibernate 3.x JPA 2.0
  • 43. JPA 2.0
    • Cache API (limited)
    • Pessimistic Locking
    • Advanced JP QL
      • CASE
      • INDEX(n)
      • CLASS(p)
    • Criteria API
    • Metamodel API
  • 44. JPA 2.0 – Strongly Typed Queries
  • 45. JPA 2.0 – Advanced Mapping
    • Collection of basic or embeddable @ElementCollection
    • Persisting list order @OrderColumn
    • Extended “map” support!
    • Nested embeddables
    • Derived identifiers
  • 46. JPA 2.0 – Advanced Mapping
    • @Entity
    • @IdClass ( PartPK . class )
    • public class Part {
    • @Id int partNo ;
    • @Id @ManyToOne
    • Supplier supplier ;
    • }
    • public class PartPK {
    • int partNo ;
    • int supplier ;
    • }
  • 47. JPA 2.0 – Standard Properties
  • 48. JPA 2.0 – Access Modes
  • 49. JPA 2.0
    • Standard
    • Multiple implementations
    • Hibernate
    • Vendor lock-in
  • 50. Agenda
    • Introduction to EE
    • What’s New
      • Overview
      • Servlet 3.0
      • Enterprise JavaBeans 3.1
      • Java Persistence API 2.0
      • Bean Validation 1.0
      • Context and Dependency Injection 1.0
      • JavaServer Facess 2.0
  • 51. Bean Validation 1.0
  • 52. Bean Validation 1.0
    • Standard Constraint Validation
    • Declarative
    • Defined on domain model
      • Constrain Once, Validate Anywhere
    • Field, property and bean level
    • Shared by all the layers
    • Runtime Validation Engine
    • Metamodel API
  • 53. Bean Validation 1.0
    • Constraint groups
    • Partial validation
    • Recursive object graph validation
    • Create your own constraints
    • i18n support for messages
  • 54. Bean Validation 1.0
  • 55. Agenda
    • Introduction to EE
    • What’s New
      • Overview
      • Servlet 3.0
      • Enterprise JavaBeans 3.1
      • Java Persistence API 2.0
      • Bean Validation 1.0
      • Context and Dependency Injection 1.0
      • JavaServer Facess 2.0
  • 56. CDI 1.0
    • Goal: Standard Dependency Injection and Lifecycle Management
    • Known also as WebBeans
    • Weld as reference implementation
    • Services
      • Resource Injection
      • Lifecycle Callbacks
      • Interceptors and Decorators
      • Events
  • 57. CDI 1.0
    • Cross tier
    • Loose coupling
    • Strong typing
    • Managed Beans
      • Container managed POJOs
      • Annotated with @ManagedBean or @Name
  • 58. CDI 1.0 @Inject @Premium Customer customer; Injection Point Qualifier (user defined-label) i.e. “which one?” Type
  • 59. CDI 1.0
    • Constructor and method injection
    • Built-in scopes
      • @RequestScope
      • @SessionScoped
      • @ApplicationScoped
      • @ConverstationScoped
      • @Dependent
    • Custom scopes
  • 60. CDI 1.0
    • Constructor and method injection
    • Built-in scopes
      • @RequestScope
      • @SessionScoped
      • @ApplicationScoped
      • @ConverstationScoped
      • @Dependent
    • Custom scopes
  • 61. CDI 1.0
  • 62. CDI 1.0
  • 63. CDI 1.0
  • 64. CDI 1.0
  • 65. CDI 1.0
  • 66. CDI 1.0
    • Standard
    • Multiple implementations
    • Portable
    • Type safe
    • Stateful support
    • Spring
    • Vendor lock-in
  • 67. Agenda
    • Introduction to EE
    • What’s New
      • Overview
      • Servlet 3.0
      • Enterprise JavaBeans 3.1
      • Java Persistence API 2.0
      • Bean Validation 1.0
      • Context and Dependency Injection 1.0
      • JavaServer Faces 2.0
  • 68. JSF 2.0 - Evolution JSF1.2 Seam Weld/CDI Ajax4JSF JSF2.0 Seam Ajax4JSF Facelets
  • 69. JSF 2.0 - Seam inheritance
    • Annotations
      • @ManagedBean
      • @ViewScoped, @RequestScoped, etc.
    • Page navigation, page actions, page parameters
    • Useful tags
      • <f:selectItems >to reference any Collection or array
  • 70. JSF 2.0 - Ajax4JSF inheritance
    • Ajax/JS support
      • <f:ajax>
      • <f:event>
  • 71. JSF 2.0 - Other features
    • Facelets templating
      • <ui:define>
      • <ui:include>
    • Resource handling
    • Composite components
  • 72. Questions?