1)Can one implement the singleton pattern as an EJB?
- I think it is not possible. Singleton pattern ensures that there is
only one instance of a particular
java class type instantiated
and used by the appliation throughout. The life-cycle of EJBs is
maintained by the Container.There is no way to control
instantiation/destruction of the beans in the code. Some App
servers provide the ability to configure the maximum number of SLSB
and MDBs that can be instantiated, but again that is vendor-specifc.
2)How will you partition the work between JSP, servlets, and EJB�s?
- Using an MVC archiecture for the project. JSP-View,
Servlets-Controller, EJBs-Model
3)Please tell us why you think you are the best candidate for this position.?
- That's a stupid question. Some people do ask this question,
especially for the junior positions, just to see what kind
of a stupid answer the candidate would give.You need to come
out with something by urself.U can also try the Jobs Discussion
forum.
4)In an n-tier application, both the web tier and the EJB tier need to
maintain session state. How will you ensure that a given client session
is mapped correctly to both of these state objects?
- I do not know the answer. Perhaps, may be the stateful session
bean's remote reference stored as part of the HttpSession Object
would help. This wouldn't work in a clustered env though.
5)What are the benefits of the Session Fa�ade pattern? When will you not use it?
-Session Facade pattern provides a single, simple interface to the
client.
- Hides the complexity of the entity bean relationships.
- Centralization of the various business interactions.The Session bean
implement the business workflow by accessing the other
session/entity beans.
- Reduces the number of remote calls, if the entity beans have only
remote interface, as remote calls are expensive to the
client.
When will I not use use Session Facade Pattern?
- I do not know the answer. Maybe if the business process is simple and the EJBs expose less number of business methods to the client.Maybe if my EJB Project has only MDBs.....I would be glad if somebody else can answer this question as I am not the expert in EJB and Patterns...
6)What are the steps you need to perform in order to develop a stateless EJB, a stateful EJB, and an entity EJB?
- The answer can be obtained in any EJB book. Try Ed Romans book at
http://www.theserverside.com/books/masteringEJB/index.jsp