1 / 16

EJB Concerns and AOP

EJB Concerns and AOP. by Neeraj Sangal. Motivation. Learn Aspect Oriented Programming and see how it can be applied to current problems. Aspect Oriented Programming. Language mechanisms to deal with cross cutting concerns

maya
Download Presentation

EJB Concerns and AOP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. EJB Concerns and AOP by Neeraj Sangal

  2. Motivation • Learn Aspect Oriented Programming and see how it can be applied to current problems

  3. Aspect Oriented Programming • Language mechanisms to deal with cross cutting concerns • The hard question for me – which concerns are best expressed as “aspects”

  4. Java – assert facility • assert ‘boolean-condition’ • Language mechanism uses assert keyword • Verify integrity of program structures • Test pre and post conditions to methods • AOP helpful in many cases not all

  5. EJB Model • Component architecture for web based applications

  6. Types of EJBs • Session • Stateless/Stateful • Entity • Bean Managed/Container Managed • Message Based

  7. AOP and EJBs • Two approaches to think about • How can the EJB operating environment benefit from AOP? • How can EJB implementers benefit from AOP? • This talk will examine the first approach • This talk won’t answer either question (sorry!)

  8. Using EJBs • Client View • Component View

  9. EJB Concerns • Database connection pooling • Persistence – automatic and programmer controlled • Transaction management • Security • Management of multiple instances of multiple components

  10. Working Set Management • Callback methods: • ejbActivate() • ejbPassivate() • Serializes current state using standard java methods

  11. Security • Define roles • Define which roles are allowed to access an ejb’s methods • What is the best way to implement this?

  12. Container Managed Transactions • The bean developer does not have to worry about transactions (is it true?) • Callbacks • afterBegin() • beforeCompletion() • afterCompletion()

  13. EntityBean • Each entity bean represents a row of data in a table • Two types • Bean Managed Persistence • Container Managed Persistence

  14. Home Interface Methods • Create Methods • Find Methods

  15. Managing Bean Instances • Callbacks • ejbActivate() • ejbPassivate() • ejbLoad() • ejbStore()

  16. Deployment Descriptor • Deployer’s responsibility – relatively independent of Bean Developer • Based on XML • Example of method permission

More Related