Transcript: New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
A new world with cdi en
1. A new world with
CDI
An essay around some of the design changes
encouraged by CDI + Seam 3
Monday, May 16, 2011
2. Who am I ?
• Software developer at R&D
department at Softplan in
Brazil
• Seam 3 Contributor
• Hobbyist game programmer
• CIA spy (it’s a secret, don’t
tell anyone)
Monday, May 16, 2011
4. Agenda
• Contextualization
Monday, May 16, 2011
5. Agenda
• Contextualization
• A quickly introduction to CDI
Monday, May 16, 2011
6. Agenda
• Contextualization
• A quickly introduction to CDI
• A real quickly introduction on Seam 3
Monday, May 16, 2011
7. Agenda
• Contextualization
• A quickly introduction to CDI
• A real quickly introduction on Seam 3
• Design simplicity with CDI
Monday, May 16, 2011
9. A little of web application history
Monday, May 16, 2011
10. The rise of Java
• CGI
• Servlet
• Servlet + JSP
• Templating, tag libraries
• The era of frameworks
Monday, May 16, 2011
11. Struts, Hibernate, Spring
• It was almost impossible to develop an application
with pure J2EE
• Different frameworks to approach different
application development needs
• Data abstractions
• IoC
• Flow control
Monday, May 16, 2011
17. CDI main goals
• The Standard glue between
JSF and EJB
• Injectable beans with
Managed lifecycle
• loose coupling
• TypeSafe
• AOP and Events
Monday, May 16, 2011
18. “CDI simplifies and
sanitizes the API for DI
and AOP”
Monday, May 16, 2011
19. “CDI simplifies and
sanitizes the API for DI
and AOP”
Rick Hightower
Monday, May 16, 2011
22. “Designing with CDI is a road to be
discovered, specially when we consider
the event handling feature”
Monday, May 16, 2011
23. “Designing with CDI is a road to be
discovered, specially when we consider
the event handling feature”
me too
Monday, May 16, 2011
24. And seam?
what is seam now after it externalized the CDI?
Monday, May 16, 2011
25. Seam’s mission is to provide a fully-
integrated development platform for
building rich, standards-based internet
applications tailored for traditional and
cloud development
Monday, May 16, 2011
43. Problems:
• Messages to the view
• Flow control
Monday, May 16, 2011
44. Messages to UI
• Proposed solution : Seam MessagesAPI
Monday, May 16, 2011
45. Flow control
• Success and Error: the typical case
• Validation can be done before the service
with Bean Validations
• In case of exceptions it could be handled
by a decoupled class (Seam Catch )
Monday, May 16, 2011
48. xml navigation pros
• More flexible than implicity navigation
• IMO, returning a string as outcome is bad
• Clean solution to totally abstract a flow
controller
• It is tool friendly
• ...
Monday, May 16, 2011
49. Let the structure do its work
JSF2 complete Reference, page 12
• JSF Complete
Monday, May 16, 2011