When writing a utility class to be used by EJBs, is there every any reason or advantage to make the class an EJB, rather than a standard java helper class?
Cheers,
Nick..
-
Helper class or EJB (1 messages)
- Posted by: Nick Stephens
- Posted on: August 28 2001 05:03 EDT
Threaded Messages (1)
- Helper class or EJB by Tom Davies on August 28 2001 07:52 EDT
-
Helper class or EJB[ Go to top ]
- Posted by: Tom Davies
- Posted on: August 28 2001 07:52 EDT
- in response to Nick Stephens
In general I'd say no.
Reasons for making it an EJB would include:
- The class needs to be distributed, i.e. the operation needs to be performed in a different EJB server to that containing the client.
- The operations on the helper class need their own transactional semantics -- for instance an operation must happen in a seperate transaction to the operation being performed by the client of the helper class.
- The helper class contains some information from a datasource, *and* you wish to use an entity bean to manage it.
But if in doubt, make it an ordinary class. It can always turn into an EJB behind a facade later if it needs to.
Tom