Warm Regards<br />vikassheelgupta<br />9911005168
Sree
SCJP, SCWCD, SCJWS, IBM 700,IBM 701, IBM 704, IBM 705, CA Clarity Technical<br /> <br /><a href="http://eddyleesinti.blogspot.com" target="_blank" rel="nofollow">http://eddyleesinti.blogspot.com</a>
Why do we require two interfaces(EJBHome interface and EJBObject interface) in an EJB?
Why cant we have create and find methods and BusinessLogic methods together in a single interface?
I think, therefore I exist -- Rene Descartes
Sree
I think, therefore I exist -- Rene Descartes
Originally posted by Valentin Tanase:
Hi Sree,
Hi Sree,
Because the EJBHome acts like an object creation factory and it is not associated with any ejb instance. From a design-relation perspective is like having a relationship course-students and having a method changeStudentAddress on the course class. Does it make much sense? Which student will be actually updated? Isn�t it more natural to have this method on the student Class? Having business methods on the creation factory class will raise the same dilemma.
However the real question is why this entire Home, Remote jndi lookup scenario for EJBs? Why in fact should EJB be components at all? I tried for a while to understand why Sun had chosen this component-based architecture for EJbs. Their main reason seems to be that one can reuse business components in a similar way .NET developer can use GUI objects through OLE-COM-DCOM technology. Well in my opinion this doesn�t stand since (arguable) in practice business components (unlike GUI components) are almost never reused (I personally never saw this happening). I read once a posting from a gentlemen and it made sense to me. He said that Sun hired some of the Microsoft engineer that implemented COM+ and MTS and they tried to implement a similar architecture for Java � EJB components. You have to understand that before EJBs there were only TCP and implicit middleware services is a concept introduced by Microsoft in late 90s. Comparing with TCP, EJB looked like a dazzling and shinning architecture. However looking at what software development should be these days, the component based architecture is far from the best choice (I�d say only one word: POJO). It took over 5 years to J2EE community in order to figure this one out and questions like yours are more then entitled. I don�t know whether to laugh or cry, but I know companies that paid millions and millions of dollars in last 5 years, to implement system base on the cutting technology edge. After five years and so much money spent they discovered that their old legacy system was replaced by another newer legacy system that should be refactored soon :-)
Regards.
I think, therefore I exist -- Rene Descartes
All that thinking. Doesn't it hurt? What do you think about this tiny ad?
We need your help - Coderanch server fundraiser
https://coderanch.com/wiki/782867/Coderanch-server-fundraiser
|