Contexts and Dependency Injection for Java EE (CDI) Magical Mystery Tour
Upcoming SlideShare
Loading in...5
×
 

Contexts and Dependency Injection for Java EE (CDI) Magical Mystery Tour

on

  • 1,637 views

This is a fast demo-driven tour of Contexts and Dependency Injection for Java EE, the new cool kid on the dependency injection block. ...

This is a fast demo-driven tour of Contexts and Dependency Injection for Java EE, the new cool kid on the dependency injection block.

We discuss features such as injection, automatic context management, scoping, qualifiers, naming, object factories, producers, disposers, dynamic lookup, stereotypes, interceptors, decorators and lightweight type-safe events. The relationship between this critical Java EE API covering generic dependency injection services and the rest of the platform including Dependency Injection for Java (JSR 330), managed beans, EJB 3, JSF and JPA will also be discussed.

Statistics

Views

Total Views
1,637
Views on SlideShare
1,637
Embed Views
0

Actions

Likes
4
Downloads
28
Comments
0

0 Embeds 0

No embeds

Accessibility

Categories

Upload Details

Uploaded via as Microsoft PowerPoint

Usage Rights

© All Rights Reserved

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
  • Full Name Full Name Comment goes here.
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

Contexts and Dependency Injection for Java EE (CDI) Magical Mystery Tour Contexts and Dependency Injection for Java EE (CDI) Magical Mystery Tour Presentation Transcript

  • 1Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public
  • Contexts and Dependency Injection for Java EE (CDI) Magical Mystery Tour Reza Rahman Java EE/GlassFish Evangelist Reza.Rahman@Oracle.com @reza_rahman
  • Program Agenda  CDI Primer  Demo  CDI Ecosystem 3Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public
  • Contexts and Dependency Injection for Java EE (CDI)  Cool new kid on dependency injection block  Synthesizes best ideas from Seam 2, Guice and Spring  Many innovations on its own right  Loose-coupling, Java-centric type-safety, annotations, expressiveness and ease-of-use  Makes Java EE much more flexible, testable, pluggable and extensible  Large ecosystem rapidly evolving around CDI 4Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public
  • CDI and Java EE 5Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public
  • CDI Features  Basic dependency injection – @Inject, @Qualifier, @Stereotype, @Alternative, @All, @Any  Component naming – @Named  Custom Object Factories – @Produces, @Disposes, InjectionPoint  Context management – @RequestScoped, @SessionScoped, @ConversationScoped, @ApplicationScoped, @Scope 6Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public
  • CDI Features  Lightweight Events – Event, @Observes  Interceptors/Decorators – @Interceptor, @InterceptorBinding, @AroundInvoke, InvocationContext, @Decorator, @Delegate  Portable extensions SPI! 7Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public
  • Weld  CDI reference implementation  Weld reference excellent documentation for CDI  Evolved from Seam 2 core  Included in GlassFish, WebLogic and JBoss AS  Can be used with Tomcat, Jetty, Java SE 8Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public
  • OpenWebBeans  Apache implementation of CDI included in Geronimo, WebSphere  Closely related to Apache OpenEJB  Great integration with Tomcat along with OpenEJB (TomEE)  Runs in standalone Java SE 9Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public
  • CanDI  Caucho implementation forms core of Resin itself  CanDI XML used to configure Resin  Use of annotations like @TransactionAttribute, @Schedule, @Asynchronous, @RolesAllowed, @RunAs, @Lock, @Startup and @Remote outside EJB in plain CDI managed beans  @PoolScoped, @TransactionScoped, @ThreadScoped  Optimized embedded container based Test Framework  CDI-PHP integration 10Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public
  • Demo Time! https://github.com/m-reza-rahman/cdi-tour 11Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public
  • CDI Ecosystem Portable Extensions Implementations Weld CanDI Tools 12Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public Runtimes
  • CDI Plugins 13Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public
  • Resources  Contexts and Dependency Injection for Java EE, http://www.cdi- spec.org  Java EE Tutorial, http://docs.oracle.com/javaee/7/tutorial/doc/partcdi.htm  OpenWebBeans, http://openwebbeans.apache.org  CanDI, http://caucho.com/projects/candi/  DeltaSpike, http://deltaspike.apache.org 14Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public
  • 15Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Insert Information Protection Policy Classification from Slide 12
  • 16Copyright © 2012, Oracle and/or its affiliates. All rights reserved. Public