• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • paul wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

Part II Design Decisions: JPA and Business Delegates

 
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello Gurus, I'm working on part II of the SCEA5 exam. I would appreciate your comments on the following:

* I want to use JPA in my design. However I'm still trying to figure out how to show this in the UML Class Diagram. I don't want to copy the classes from the provided domain model specifying an "Entity" StereoType for each. Any pointers? I want to have a Stateless Session EJB in front of the entities as the "Orchestra Director".

* Since I'm using JEE 5 I guess that I can use Dependency Injection to locate EJBs (from managed components) so there's no need to create a Business Delegate. However, the B.D. pattern decouples the Web Tier from the Business Tier. So both approaches "race" each other. Any comments?

Best Regards,

Jose M. Selman
 
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
In Sun's version of class diagram we show the domain model classes with complete relationships and sessionBeans as given in Mark Cade's book.You do not need to show JPA here since it is meant to be technology neutral. I am not an SCEA so suggest you wait for the views of other experts.
 
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
* I don't see anything wrong with using the classes provided in the business domain model and stereotyping them with Entity stereotype. For you Orchestra Director stateless session bean, you can use the Model Facade pattern. It is described very well in the Java EE blueprints at https://blueprints.dev.java.net/bpcatalog/ee5/persistence/ejbfacade.html


* The BusinessDelegate is meant to separate presentation tier logic from business logic. Also, you can handle container specific exceptions in your Business Delegate classes and only pass application specific exceptions to the business tier. And if your project requirements are such that you might need multiple presentation tiers in the future, having a common entry point with a Business Delegate can be very helpful.

However, since the Business Delegate is a POJO, you will not be able to use dependency injection to look up your Session Facade classes. You will have to use a Service Locator design pattern to do that.
 
Pratik Das
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I think you can still use dependency injection by means of a setter method in your business delegate and receiving the reference from the calling managed component(which has access to the resource by means of DI).
 
author and cow tipper
Posts: 5009
1
Hibernate Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Where you may have been tempted to put a business delegate, could you put a service object instead? Service objects are great!

-Cameron McKenzie
reply
    Bookmark Topic Watch Topic
  • New Topic