EJB or Not Denver BEA User's Group Sept 2003

555 views
496 views

Published on

An overview of the pros and cons of adopting EJB in enterprise java development

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
555
On SlideShare
0
From Embeds
0
Number of Embeds
15
Actions
Shares
0
Downloads
3
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

EJB or Not Denver BEA User's Group Sept 2003

  1. 1. EJB or Not Scott Ryan Denver BEA User ’ s Group September 2003
  2. 2. Big Topic Little Time
  3. 3. References <ul><ul><li>EJB 1.0 </li></ul></ul><ul><ul><li>EJB 1.1 </li></ul></ul><ul><ul><li>EJB 2.0 </li></ul></ul><ul><ul><li>EJB 2.1 http://java.sun.com/products/ejb/docs.html#specs </li></ul></ul><ul><ul><li>Bitter EJB - Manning Publications Co. </li></ul></ul><ul><ul><li>JBoss and AOP www.jboss.org/ </li></ul></ul><ul><ul><li>Programming Weblogic EJBs </li></ul></ul>
  4. 4. Golden Hammer or NACL
  5. 5. What are the Ingredients? <ul><ul><li>Stateless Session Beans </li></ul></ul><ul><ul><li>Stateful Session Beans </li></ul></ul><ul><ul><li>Entity Beans </li></ul></ul><ul><ul><ul><li>Bean Managed </li></ul></ul></ul><ul><ul><ul><li>Container Managed (CMR?) </li></ul></ul></ul><ul><ul><li>Message Driven Beans </li></ul></ul>
  6. 6. What is in it for me? <ul><ul><li>Distributed Component Model </li></ul></ul><ul><ul><li>Pooling/Sharing </li></ul></ul><ul><ul><li>Security </li></ul></ul><ul><ul><li>Transactions </li></ul></ul><ul><ul><li>Asynchronous Behavior (MDB) </li></ul></ul>
  7. 7. Is that the one I had before? Stateless Session Beans <ul><ul><li>Good for one Method Call </li></ul></ul><ul><ul><li>Pooled and shared for performance </li></ul></ul><ul><ul><li>Can store Instance Information </li></ul></ul><ul><ul><li>What happens with Instance Variables? </li></ul></ul>
  8. 8. Where do put I my state? Stateful Session Beans <ul><ul><li>What is the efficient way to store state </li></ul></ul><ul><ul><li>When is the persistence done </li></ul></ul><ul><ul><li>Cluster Aware </li></ul></ul><ul><ul><li>Multiple ways to persist </li></ul></ul><ul><ul><ul><li>Memory, Files, Database </li></ul></ul></ul><ul><ul><li>Be careful what you store and how </li></ul></ul><ul><ul><li>Seek other ways to persist complex data </li></ul></ul>
  9. 9. Wow Look at all I get Entity Beans <ul><ul><li>Not just a persistence mechanism </li></ul></ul><ul><ul><ul><li>There are better ways to persist </li></ul></ul></ul><ul><ul><li>Understand how to tune with deployment Descriptors </li></ul></ul><ul><ul><ul><li>Persistence </li></ul></ul></ul><ul><ul><ul><li>Pooling </li></ul></ul></ul><ul><ul><ul><li>Transactions </li></ul></ul></ul><ul><ul><ul><li>Security </li></ul></ul></ul>
  10. 10. Wow Look at all I get (Continued) <ul><ul><li>Concurrency </li></ul></ul><ul><ul><ul><li>Exclusive, Database, Optimistic, Read-only, Read Mostly </li></ul></ul></ul><ul><ul><li>Caching Strategies </li></ul></ul><ul><ul><li>Lazy Loading </li></ul></ul><ul><ul><li>Clustering and Load Balancing </li></ul></ul><ul><ul><li>Local VS Remote </li></ul></ul>
  11. 11. What is going on?
  12. 12. What is all this? CMR <ul><ul><li>Watch the depth of relationships </li></ul></ul><ul><ul><li>Leverage Concurrency, Caching, Lazy Loading but be careful </li></ul></ul><ul><ul><li>Very efficient when used correctly </li></ul></ul>
  13. 13. How do I call you? Message Driven Beans <ul><ul><li>Very useful to control Asynchronous activity </li></ul></ul><ul><ul><li>Design to run standalone (asynchronously) </li></ul></ul><ul><ul><li>Tune the number to support the load </li></ul></ul><ul><ul><li>Handle ALL message types </li></ul></ul><ul><ul><li>Be careful what you do with exceptions </li></ul></ul><ul><ul><li>Keep it light (implementation and message size) </li></ul></ul>
  14. 14. Who changed my bean? AOP and JBoss <ul><ul><li>Code added during run time </li></ul></ul><ul><ul><ul><li>Horizontal extension via bytecode injection </li></ul></ul></ul><ul><ul><ul><li>Can I trust the implementation? </li></ul></ul></ul><ul><ul><ul><li>Similar to JDO implementation but on a larger scale </li></ul></ul></ul><ul><ul><li>Possible alternative to EJBs </li></ul></ul><ul><ul><ul><li>Selectively add functionality to POJOs </li></ul></ul></ul>
  15. 15. Tidbits of Knowledge <ul><ul><li>EJB ’ s have huge value when used correctly </li></ul></ul><ul><ul><li>Plan your interfaces carefully </li></ul></ul><ul><ul><li>Don ’ t write code that you can generate </li></ul></ul><ul><ul><ul><li>Xdoclet, EJBGEN, Reverse EJBGEN </li></ul></ul></ul><ul><ul><li>Understand what is going on under the covers </li></ul></ul><ul><ul><li>Use deployment options to tune implementation </li></ul></ul><ul><ul><li>Leverage experience of others </li></ul></ul><ul><ul><li>Remember the alternatives </li></ul></ul>
  16. 16. Tidbits of Knowledge (cont) <ul><ul><li>Be careful when using inheritance </li></ul></ul><ul><ul><li>Understand reentrancy and Idempotency </li></ul></ul><ul><ul><li>Plan your exception handling </li></ul></ul><ul><ul><li>Understand the object lifecycles </li></ul></ul><ul><ul><li>Don ’ t spawn threads or interfere with Container code </li></ul></ul>

×