wood burning stoves 2.0*
The moose likes EJB and other Java EE Technologies and the fly likes design decision: variation of session fassade Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "design decision: variation of session fassade" Watch "design decision: variation of session fassade" New topic
Author

design decision: variation of session fassade

nimo frey
Ranch Hand

Joined: Jun 28, 2008
Posts: 580
Actually, I have all my jpa-queries within a Stateless Session Bean.

Look at that:





Now, I am wondering what will be the drawbacks,
if I use a static method within the PersistenceBean returning the related Query-Instance to my session bean:






My Questions:

1. What version is better, version 1 or version 2 ? Why?

2. Are there any pitfalls when using entityManager-Instance within a static method?

3. Are there any lacks of performance when using a static method to retrieve a query-instance instead of retrieving it via a typical (non-static) ejb-method (for example, because of pooling or transaction, ..)?

4. In generally, are there any pittfalls, drawbacks, performance losses when using or invoking static methods within a ejb-bean ?

In my opinion, version 2 is better because of maintenance: I have all my query-related things of a object within the object itself. But I am really in doubt about my opinion.
 
It is sorta covered in the JavaRanch Style Guide.
 
subject: design decision: variation of session fassade