As the adoption of Contexts and Dependency Injection (CDI) for Java EE API grows, it is important to understand how to use CDI effectively to maximize the benefits of using a loosely coupled, type-safe, annotation-driven dependency injection solution. This session outlines the best practices for using CDI, such as annotations versus XML, @Named as a qualifier, qualifier type safety versus verbosity, effective use of producers/disposers, using scopes properly, best practices for using conversations, defining effective stereotypes, interceptors versus decorators, static versus dynamic injection/lookup, CDI versus Java EE resource injection, using CDI with EJB 3.1, CDI/JSF 2 integration patterns, and CDI/JPA 2 usage patterns.
A presentation on the audit mandate of SAI of India as per various provisions contained in the Comptroller and Auditor General's (Duties, Power and Conditions of Service) Act, 1971 for the users.
The Minimum Wages Act 1948 is an Act of Parliament concerning Indian labour law that sets the minimum wages that must be paid to skilled and unskilled labour.
Top 10 law professor interview questions and answersjessicacindy3
In this file, you can ref interview materials for law professor such as types of interview questions, law professor situational interview, law professor behavioral interview…
PERSON:
Income-tax is charged in respect of the total income of the previous year of every person. Hence, it is important to know the definition of the word person. As per section 2(31),Person includes:
an Individual
a Hindu Undivided Family (HUF)
a Company
a Firm
an Association of Persons or a Body of Individuals (BOI) whether incorporated or not
a Local Authority
every Artificial, Juridical person, not falling within any of the above
To understand the concept of Taxation, heads of income, including foreign income assessment procedures, adjudication and settlement of tax disputes are the focus points of study
in this paper.
Concept of residence under income tax act (with the concept of dtaa and poem)Amitabh Srivastava
The concept of Residence under Income tax is a very critical issue as incidence of tax differs on the basis of Residential nature of the assessee.Further the concept of POEM and DTAA is very relevant issues which are to be read with it.
The future of enterprise dependency injection: Contexts & Dependency Injectio...Paul Bakker
Talk about the Contexts & Dependency Injection specification introduced in Java EE 6. It's a basic introduction to the most important concepts of the specification.
The slide were made for a 50 minute talk at the NL-JUG conference in November 2009.
A presentation on the audit mandate of SAI of India as per various provisions contained in the Comptroller and Auditor General's (Duties, Power and Conditions of Service) Act, 1971 for the users.
The Minimum Wages Act 1948 is an Act of Parliament concerning Indian labour law that sets the minimum wages that must be paid to skilled and unskilled labour.
Top 10 law professor interview questions and answersjessicacindy3
In this file, you can ref interview materials for law professor such as types of interview questions, law professor situational interview, law professor behavioral interview…
PERSON:
Income-tax is charged in respect of the total income of the previous year of every person. Hence, it is important to know the definition of the word person. As per section 2(31),Person includes:
an Individual
a Hindu Undivided Family (HUF)
a Company
a Firm
an Association of Persons or a Body of Individuals (BOI) whether incorporated or not
a Local Authority
every Artificial, Juridical person, not falling within any of the above
To understand the concept of Taxation, heads of income, including foreign income assessment procedures, adjudication and settlement of tax disputes are the focus points of study
in this paper.
Concept of residence under income tax act (with the concept of dtaa and poem)Amitabh Srivastava
The concept of Residence under Income tax is a very critical issue as incidence of tax differs on the basis of Residential nature of the assessee.Further the concept of POEM and DTAA is very relevant issues which are to be read with it.
The future of enterprise dependency injection: Contexts & Dependency Injectio...Paul Bakker
Talk about the Contexts & Dependency Injection specification introduced in Java EE 6. It's a basic introduction to the most important concepts of the specification.
The slide were made for a 50 minute talk at the NL-JUG conference in November 2009.
Java is an object-oriented programming language. It is used in a variety of computing platforms, you can see it nearly everywhere nowadays, from embedded devices and mobile phones to enterprise servers and supercomputers.
Hybernat and structs, spring classes in mumbai
best Hybernat and structs, spring classes in mumbai with job assistance.
our features are:
expert guidance by it industry professionals
lowest fees of 5000
practical exposure to handle projects
well equiped lab
after course resume writing guidance
In this Java Spring Training session, you will learn Spring – Inversion of Control, Dependency Injection and Bean definitions. Topics covered in this session are:
For more information, visit this link:
Spring Framework
• Core Container
• Data Access/Integration
• Web Layer
• Spring Setup
• Key features
• Spring Bean
• Dependency Injection
• Relation between DI and IoC
• Spring IoC Containers
• Spring DI
https://www.mindsmapped.com/courses/software-development/spring-fundamentals-learn-spring-framework-and-spring-boot/
Session 43 - Spring - Part 1 - IoC DI BeansPawanMM
In this session you will learn:
1.Spring Framework
2. Core Container
3. Data Access/Integration
4. Web Layer
5. Spring Setup
6. Key features
7. Spring Bean
8. Dependency Injection
9. Relation between DI and IoC
10. Spring IoC Containers
11. Spring DI
Similar to CDI Best Practices with Real-Life Examples - TUT3287 (20)
How Recreation Management Software Can Streamline Your Operations.pptxwottaspaceseo
Recreation management software streamlines operations by automating key tasks such as scheduling, registration, and payment processing, reducing manual workload and errors. It provides centralized management of facilities, classes, and events, ensuring efficient resource allocation and facility usage. The software offers user-friendly online portals for easy access to bookings and program information, enhancing customer experience. Real-time reporting and data analytics deliver insights into attendance and preferences, aiding in strategic decision-making. Additionally, effective communication tools keep participants and staff informed with timely updates. Overall, recreation management software enhances efficiency, improves service delivery, and boosts customer satisfaction.
Enhancing Research Orchestration Capabilities at ORNL.pdfGlobus
Cross-facility research orchestration comes with ever-changing constraints regarding the availability and suitability of various compute and data resources. In short, a flexible data and processing fabric is needed to enable the dynamic redirection of data and compute tasks throughout the lifecycle of an experiment. In this talk, we illustrate how we easily leveraged Globus services to instrument the ACE research testbed at the Oak Ridge Leadership Computing Facility with flexible data and task orchestration capabilities.
Quarkus Hidden and Forbidden ExtensionsMax Andersen
Quarkus has a vast extension ecosystem and is known for its subsonic and subatomic feature set. Some of these features are not as well known, and some extensions are less talked about, but that does not make them less interesting - quite the opposite.
Come join this talk to see some tips and tricks for using Quarkus and some of the lesser known features, extensions and development techniques.
Understanding Globus Data Transfers with NetSageGlobus
NetSage is an open privacy-aware network measurement, analysis, and visualization service designed to help end-users visualize and reason about large data transfers. NetSage traditionally has used a combination of passive measurements, including SNMP and flow data, as well as active measurements, mainly perfSONAR, to provide longitudinal network performance data visualization. It has been deployed by dozens of networks world wide, and is supported domestically by the Engagement and Performance Operations Center (EPOC), NSF #2328479. We have recently expanded the NetSage data sources to include logs for Globus data transfers, following the same privacy-preserving approach as for Flow data. Using the logs for the Texas Advanced Computing Center (TACC) as an example, this talk will walk through several different example use cases that NetSage can answer, including: Who is using Globus to share data with my institution, and what kind of performance are they able to achieve? How many transfers has Globus supported for us? Which sites are we sharing the most data with, and how is that changing over time? How is my site using Globus to move data internally, and what kind of performance do we see for those transfers? What percentage of data transfers at my institution used Globus, and how did the overall data transfer performance compare to the Globus users?
Software Engineering, Software Consulting, Tech Lead.
Spring Boot, Spring Cloud, Spring Core, Spring JDBC, Spring Security,
Spring Transaction, Spring MVC,
Log4j, REST/SOAP WEB-SERVICES.
Enterprise Resource Planning System includes various modules that reduce any business's workload. Additionally, it organizes the workflows, which drives towards enhancing productivity. Here are a detailed explanation of the ERP modules. Going through the points will help you understand how the software is changing the work dynamics.
To know more details here: https://blogs.nyggs.com/nyggs/enterprise-resource-planning-erp-system-modules/
Providing Globus Services to Users of JASMIN for Environmental Data AnalysisGlobus
JASMIN is the UK’s high-performance data analysis platform for environmental science, operated by STFC on behalf of the UK Natural Environment Research Council (NERC). In addition to its role in hosting the CEDA Archive (NERC’s long-term repository for climate, atmospheric science & Earth observation data in the UK), JASMIN provides a collaborative platform to a community of around 2,000 scientists in the UK and beyond, providing nearly 400 environmental science projects with working space, compute resources and tools to facilitate their work. High-performance data transfer into and out of JASMIN has always been a key feature, with many scientists bringing model outputs from supercomputers elsewhere in the UK, to analyse against observational or other model data in the CEDA Archive. A growing number of JASMIN users are now realising the benefits of using the Globus service to provide reliable and efficient data movement and other tasks in this and other contexts. Further use cases involve long-distance (intercontinental) transfers to and from JASMIN, and collecting results from a mobile atmospheric radar system, pushing data to JASMIN via a lightweight Globus deployment. We provide details of how Globus fits into our current infrastructure, our experience of the recent migration to GCSv5.4, and of our interest in developing use of the wider ecosystem of Globus services for the benefit of our user community.
Listen to the keynote address and hear about the latest developments from Rachana Ananthakrishnan and Ian Foster who review the updates to the Globus Platform and Service, and the relevance of Globus to the scientific community as an automation platform to accelerate scientific discovery.
Climate Science Flows: Enabling Petabyte-Scale Climate Analysis with the Eart...Globus
The Earth System Grid Federation (ESGF) is a global network of data servers that archives and distributes the planet’s largest collection of Earth system model output for thousands of climate and environmental scientists worldwide. Many of these petabyte-scale data archives are located in proximity to large high-performance computing (HPC) or cloud computing resources, but the primary workflow for data users consists of transferring data, and applying computations on a different system. As a part of the ESGF 2.0 US project (funded by the United States Department of Energy Office of Science), we developed pre-defined data workflows, which can be run on-demand, capable of applying many data reduction and data analysis to the large ESGF data archives, transferring only the resultant analysis (ex. visualizations, smaller data files). In this talk, we will showcase a few of these workflows, highlighting how Globus Flows can be used for petabyte-scale climate analysis.
Gamify Your Mind; The Secret Sauce to Delivering Success, Continuously Improv...Shahin Sheidaei
Games are powerful teaching tools, fostering hands-on engagement and fun. But they require careful consideration to succeed. Join me to explore factors in running and selecting games, ensuring they serve as effective teaching tools. Learn to maintain focus on learning objectives while playing, and how to measure the ROI of gaming in education. Discover strategies for pitching gaming to leadership. This session offers insights, tips, and examples for coaches, team leads, and enterprise leaders seeking to teach from simple to complex concepts.
Custom Healthcare Software for Managing Chronic Conditions and Remote Patient...Mind IT Systems
Healthcare providers often struggle with the complexities of chronic conditions and remote patient monitoring, as each patient requires personalized care and ongoing monitoring. Off-the-shelf solutions may not meet these diverse needs, leading to inefficiencies and gaps in care. It’s here, custom healthcare software offers a tailored solution, ensuring improved care and effectiveness.
Into the Box Keynote Day 2: Unveiling amazing updates and announcements for modern CFML developers! Get ready for exciting releases and updates on Ortus tools and products. Stay tuned for cutting-edge innovations designed to boost your productivity.
Enhancing Project Management Efficiency_ Leveraging AI Tools like ChatGPT.pdfJay Das
With the advent of artificial intelligence or AI tools, project management processes are undergoing a transformative shift. By using tools like ChatGPT, and Bard organizations can empower their leaders and managers to plan, execute, and monitor projects more effectively.
top nidhi software solution freedownloadvrstrong314
This presentation emphasizes the importance of data security and legal compliance for Nidhi companies in India. It highlights how online Nidhi software solutions, like Vector Nidhi Software, offer advanced features tailored to these needs. Key aspects include encryption, access controls, and audit trails to ensure data security. The software complies with regulatory guidelines from the MCA and RBI and adheres to Nidhi Rules, 2014. With customizable, user-friendly interfaces and real-time features, these Nidhi software solutions enhance efficiency, support growth, and provide exceptional member services. The presentation concludes with contact information for further inquiries.
Developing Distributed High-performance Computing Capabilities of an Open Sci...Globus
COVID-19 had an unprecedented impact on scientific collaboration. The pandemic and its broad response from the scientific community has forged new relationships among public health practitioners, mathematical modelers, and scientific computing specialists, while revealing critical gaps in exploiting advanced computing systems to support urgent decision making. Informed by our team’s work in applying high-performance computing in support of public health decision makers during the COVID-19 pandemic, we present how Globus technologies are enabling the development of an open science platform for robust epidemic analysis, with the goal of collaborative, secure, distributed, on-demand, and fast time-to-solution analyses to support public health.
Large Language Models and the End of ProgrammingMatt Welsh
Talk by Matt Welsh at Craft Conference 2024 on the impact that Large Language Models will have on the future of software development. In this talk, I discuss the ways in which LLMs will impact the software industry, from replacing human software developers with AI, to replacing conventional software with models that perform reasoning, computation, and problem-solving.
We describe the deployment and use of Globus Compute for remote computation. This content is aimed at researchers who wish to compute on remote resources using a unified programming interface, as well as system administrators who will deploy and operate Globus Compute services on their research computing infrastructure.
CDI Best Practices with Real-Life Examples - TUT3287
1. CDI Best Practices with
Real-Life Examples
Ahmad Gohar
Software Architect & Technical Team Lead
IBM Experienced IT-Specialist
Client Innovation Center (CIC), IBM
TUT3287
2.
3. Gohar , Ahmad Nabil
• Software Architect & Technical Team Lead (9Y.) | CIC, IBM.
• IBM/Open Group Certified Experienced IT Specialist.
• M.Sc. in Information System, FCI, Egypt.
• MIBA in Global Management, ESLSCA, France.
• OCEJPA | OCPWCD | OCPJP | OCP PL/SQL | MCP(s).
• JAVA Community Process (JCP) Member.
• Blogger Author and Academic Researcher.
8. What is CDI (JSR 299)?
• Java Specification Requests
• JSR is a document of a proposed specification used in the Java Community
Process (JCP).
• Classes specify what their dependencies
• NOT how to obtain them (container responsibility)
9. What is CDI (JSR 299)?
• Provides a unifying Dependency Injection and contextual life-cycle
model for Java EE
• Unified existing Dependency Injection schemes – Spring, Guice, Seam
• A completely new, richer dependency management model
• Type-safe dependency injection
• Designed for use with stateful objects (scoped objects)
10. What is CDI (JSR 299)?
• Makes it much easier to build applications using JSF and EJB
together
• Let you use EJBs directly as JSF managed beans
12. What is Weld?
• The CDI Reference Implementation (RI)
• Service Provider Interfaces (SPI)
• Weld provides a complete SPI allowing Java EE containers to use
CDI implementation
• Weld also runs in servlet engines, or even in a plain Java SE
environment
14. CDI is more than a framework
• It’s a whole, rich programming model
• The theme of CDI is loosecoupling with strong typing.
• A bean specifies only the type and semantics of other beans it depends upon
• It need not be aware of the actual lifecycle, concrete implementation,
threading model or other clients of any bean it interacts with
• Even better, the concrete implementation, lifecycle and threading model of
a bean may vary according to the deployment scenario, without affecting
any client
• This loose-coupling makes your code easier to maintain
15. CDI theme – Loose coupling with Strong typing
• Events, interceptors and decorators enhance the loose-coupling
inherent in this model:
• Event notifications
• Decouple event producers from event consumers
• Interceptors
• Decouple technical concerns from business logic
• Decorators
• Allow business concerns to be compartmentalized
16. CDI theme – Loose coupling
• Decouple Server (dependency) and client (dependency user)
• Using well-defiend types and qualifiers
• Allows server implementations to vary
• Decouple lifecycle of collaboration components (dependencies) from
application (dependency user)
• Automatic contextual life-cycle management by the CDI runtime
• Decouple orthogonal concerns (AOP) from business logic
• Interceptors & Decorators
• Decouple message producer from consumer
• Events
17. CDI theme – Strong typing
• Type-based injection has advantages of
• No more reliance on string-based names
• Compiler can detect type errors at compile time
• Casting mostly eliminated
• Strong tooling possible
• Semantic code errors (errors that can't be detected by the compiler) can
be detected at application start-upon
• Tools can detect ambiguous dependencies
• Leverages Java type system
• @Annotation
• <TypeParam>
21. Automatic Bean Discovery
• • How can container scan bean?
• By detecting the presence of “beans.xml” in application archive
• For WAR file, the “beans.xml” is under WEB-INF directory
• For JAR file, the “beans.xml” is under META-INF directory
• • “beans.xml”
• It is not for declaring beans (like in Spring)
• It can be empty
• Used for some other purposes (like declaring an alternative)
27. What is a Bean anyway?
• Many forms of a “bean” already exist. So which bean arewe talking
about?
• JSF bean
• EJB bean
• Spring bean
• Seam bean
• Guice bean
• CDI bean
• Java EE needs a unified bean definition
• Managed Bean 1.0 specification in Java EE 6 provides it
28. What about Managed, EJB, REST, CDI Bean?
• Managed Beans are container-managed POJOs
• Lightweight component model
• Instances are managed by the container
• You could see everything as a Managed Bean with extra services
• • An EJB is a Managed Bean with
• Transaction support
• Security
• Thread safety
• Persistence
• • A REST service is a Managed Bean with
• HTTP support
• • A CDI bean is a Managed Bean with
• CDI services (explained in the next slide)
29. CDI is more than a framework
• Auto-discovered
• by the container
• Set of qualifiers
• solves ambiguity
• Scope
• context of a bean
• Bean EL name
• support non-type based invocation
• Set of interceptor bindings
• Alternative
• replace bean at deployment time
32. Q : How to Inject CDI Beans (Injection Point) ?
33. CDI Injection Point
• Use @Inject <Java-Type> <variable> for field injection
• <Java-Type> can be Java interface
• Bean can be injected at “Injection points”
• Field
• Method parameter
• Method can be
• Constructor (useful for created immutable object)
• Initializer
• Setter method
• Producer
• Observer
38. Q : What is the result of injecting CDI beans that :-
1- have single Implementation ?
2- have no Implementation ?
3- have multiple Implementation ?
39. What is a Qualifier?
• For a given bean type (class or interface), there may be multiple
beans which implement the type (in the classpath)
• For an interface, there could be multiple implementations
• For a class, there could be multiple child types
• Ambiguity error will result
• A qualifier is an annotation that lets a client choose one between
multiple candidates of a certain type
• Make type more specific
• Assigns semantic meaning
• Injected type is identified by
• Qualifier(s) + Java type
40.
41.
42.
43. Qualifier and Type Safety (Strong Typing)
• Qualifier + Java type makes a composite type (extended type)
• Again, think of a Qualifier as a type
• Qualifiers make type safe injection possible
• Qualifiers replace “look-up via string-based names”
• Qualifier and Type Safety (Strong Typing)
45. What is Alternative Bean?
• Any bean with @Alternative is not considered for injection
• Lets you package multiple beans that match injection type without ambiguity errors
• In order to be considered for injection, it has to be activated in “beans.xml”
• Provide a replacement implementation during deployment
• You can apply the @Alternative annotation to two or more beans, then, based on
your deployment, specify the bean you want to use in the “beans.xml” configuration
file
• Useful for providing mock objects for testing – mock objects are annotated with
@Alternative
51. Request – @RequestScoped
• This scope describes a user’s interaction with a web
application in a single HTTP request.
• The instance of the @RequestScoped annotated
bean has an HTTP request lifecycle.
52. Session – @SessionScoped
• This scope describes a user’s interaction with a web
application across multiple HTTP requests.
53. Application – @ApplicationScoped
• In this case the state is shared across all users’
interactions with a web application.
• The container provides the same instance of the
@ApplicationScoped annotated bean to all client
requests.
54. Dependent – @Dependent pseudo-scope
• This pseudo-scope means that an object exists to serve
exactly one client (bean) and has the same lifecycle as
that client (bean).
• This is the default scope for a bean which does not
explicitly declare a scope type.
• An instance of a dependent bean is never shared
between different clients or different injection points.
• It is strictly a dependent object of some other object.
• It is instantiated when the object it belongs to is
created, and destroyed when the object it belongs to
is destroyed.
55.
56.
57. View – @ ViewScoped
• @ViewScoped belongs to JSF specification
• Retains the scope lifespan for current page view
• If the controller navigates away to a different page
view the bean is de-scoped
• Therefore view-scope is great for form validation
and rich AJAX request and response sequences!
58. Conversation – @ConversationScoped
• A lifespan sits between a Http Request scope and
Http Session scope
• Maintains state for the unique interaction
• Works for individual tab in web browsers
• Better than @ViewScoped bean controllers
• Application defined lifespan
59.
60. Session & Conversation Scoped Bean
• A thing to notice is that beans must be serializable.
• This is because the container passivates the HTTP
session from time to time, so when the session is
activated again the beans’ state must be retrieved.
61. Singleton – @Singleton pseudo-scope
• This is a pseudo-scope.
• It defines that a bean is once instantiated.
• When a CDI managed bean is injected into another
bean, the CDI container makes use of a proxy.
• The proxy is the one to handle calls to the bean.
• Though, @Singleton annotated beans don’t have a
proxy object.
• Clients hold a direct reference to the singleton
instance.
62. Singleton – @Singleton pseudo-scope
• So, what happens when a client is serialized ?
• We must ensure that the singleton bean remains a
singleton.
• To do so there are a fiew ways, such as, have the
singleton bean implement writeResolve() and
readReplace() (as defined by the Java serialization
specification), make sure the client keeps only a
transient reference to the singleton bean, or give
the client a reference of type Instance<X> where X
is the bean type of the singleton bean.
63. Contextual scope
• All predefined scopes except @Dependent are contextual
scopes.
• CDI places beans of contextual scope in the context whose
lifecycle is defined by the Java EE specifications.
• For example, a session context and its beans exist during the
lifetime of an HTTP session.
• Injected references to the beans are contextually aware.
• The references always apply to the bean that is associated
with the context for the thread that is making the reference.
The CDI container ensures that the objects are created and
injected at the correct time as determined by the scope that
is specified for these objects.
66. Interceptors
• Interceptor functionality is defined in the Java Interceptors
specification.
• The Interceptors specification defines three kinds of interception
points:
• Business method interception,
• Lifecycle callback interception, and
• Timeout method interception (EJB only).
• A business method interceptor applies to invocations of methods
of the bean by clients of the bean
• By default, all interceptors are disabled
67. Business Method Interceptor
• A business method interceptor applies to invocations of methods
of the bean by clients of the bean
68. Lifecycle Callback Interceptor
• A lifecycle callback interceptor applies to invocations of lifecycle
callbacks by the container
• An interceptor class may intercept both lifecycle callbacks and
business methods
69. Timeout Method Interceptor
• A timeout method interceptor applies to invocations of EJB
timeout methods by the container
72. Q : What is the deference between Interceptor and Decorators in CDI ?
73. What is a Decorator?
• Decorators implement the Decorator design pattern
• Allows implementation of an additional business logic for a bean
• A Decorator decorates interfaces they implement
• @Delegate is used to inject the original object
• Original object business logic can be be invoked within the decorator
• Decorators must be activated through “beans.xml”
74.
75.
76. Interceptors VS Decorators
• Interceptors and Decorators both geared towards cross-cutting
logic.
• Bypass traditional complexity associated with AOP by avoiding
point-cuts.
• Interceptors are designed for system-level crosscutting concerns
very decoupled from business logic.
• Decorators intended for concerns that should be
compartmentalized but are still very close to business logic.
79. CDI Event Observer Pattern
• Completely decouple action (event producer) and reactions
• (event consumers)
• Qualifiers tune which event notifications are received
• Define Event Class
• Event producer fires an event
• Event consumer observes event through @Observes
80. Event
• Event Producers
• An event is fired by an injected javax.enterprise.event.Event object
• Event Consumer (Event Observer)
• The only thing event consumer has to do is to use @Observes <Event-class>
annotation
84. When you still need EJB ? … not yet aligned!
• Security
• @RolesAllowed
• @PermitAll
• @DenyAll
• Usable by
• @Stateless
• @Stateful
• @Singleton
85. When you still need EJB ? … not yet aligned!
• Startup
• @Startup
• Eagerly creates the instance upon startup
• Usable by
• @Singleton
86. When you still need EJB ? … not yet aligned!
• Asynchronous
• @Asynchronsous
• Allows method calls to be asynchronous and return Future objects
• Usable by
• @Stateless
• @Stateful
• @Singleton
87. When you still need EJB ? … not yet aligned!
• Schedule
• @Schedule
• Effectively Cron -- schedule invocations by minute or date, etc.
• Usable by
• @Stateless
• @Singleton
• Not @Stateful
88. When you still need EJB ? … not yet aligned!
• Locking
• @Lock(READ
• @Lock(WRITE)
• @AccessTimeout
• Allows for synchronization of methods without complex code
• Usable by
• @Singleton
• Not @Stateless
• Not @Stateful
89. When you still need EJB ? … not yet aligned!
• MDBs
• @MessageDriven
• Connector-Driven Beans
• Usable by
• Not @Singleton
• Not @Stateless
• Not @Stateful
90. CDI Takeover
• EJB adopts CDI (Java EE 6)
• JSF adopts CDI (Java EE 7)
• MVC adopts CDI (Java EE 8)
• JAX-RS considers CDI (Java EE 8)
• CDI moves to SE (Java EE 8)
91. Common Mistakes you will make
• Not putting a beans.xml in your app (Java EE 6)
• No CDI for you!
• Not understanding @Typed
• 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
92. Result for EJB after CDI ?
• Java EE 7
• Focus on realignment: @Transactional
• • Java EE 8
• First spec round with no new EJB JSR
• Realignment stalled
• Awkward relationship
96. Biggest benefits of CDI
• Very active and open expert group
• Fully extendable
• Beans can be added at runtime
• Fully Open Source
• Spec is open source
• All implementations are open source
• Compliance test (TCK) suite is open source