Hi,

We go one step further and use a plain class with static methods to obtain 
Home interfaces - one method per Home.  The class uses a stateless session 
bean just as you describe for the FIRST lookup, but thereafter uses a 
cached value that it saves.  That makes the scheme both more efficient and 
simpler to use (because the client can just write 
MyHomeFinder.getMyBeanHome() rather than having to go through the steps of 
looking up the stateless session bean).

If you decide to try this scheme PLEASE NOTE that the client code STILL 
REQUIRES an ejb-ref for the stateless session bean.  This is because the 
plain class is running in the same context as the client, and it may have 
to find the stateless session bean.

Nick

At 12:42 PM 2/7/01 +0100, you wrote:

>Hello Christian,
>
>CB> I noticed that I needed to reference all the homes of my EJBs within the
>CB> web.xml and I wanted to know if it was recommended/safe to create one
>CB> stateless session bean which has all the ejb-ref needed in its ejb-jar.xml
>CB> and only reference that stateless session bean from my web app.  This 
>way my
>CB> web app only needs to know about one Session Bean and that bean's
>CB> responsibility is factoring other home.
>
>CB> Does anyone see any problem with this approach?
>
>We did that for our project and it works fine.
>
>One 'SystemBean' session beans has all ejb-refs, and all other
>beans only need to know about the SystemBean and can call a
>getHome( String jndiName ) to obtain home interfaces..
>
>I don't see any disadvantages except of the small performance
>decrease, because you have an additional bean lookup/method call.
>But as far as I can see, this decrease is very very small.
>
>Greetings from Munich,
>
>  /Thomas
>
>--
>
>| /Thomas Hertz   |           [y] hybris GmbH | Software Engineering |
>| [EMAIL PROTECTED] | Schwere-Reiter-Strasse 35 | tel +49 89 306697- 0 |
>| www.hybris.de   | Haus 16, D-80797 Muenchen | fax +49 89 306697-99 |
>| pgp fingerprint: D070 5D86 BE2D C3AF E2CC D2D8 C29A 7F68 7407 629E |
>


Reply via email to