This is the classic tension between OO and distributed computing. This is not a new problem, nor is it specific to EJB.
OO is very nice, but if you are doing it in the real world and you forget for a moment, it will not be pretty... -----Original Message----- From: Amarnath P To: [EMAIL PROTECTED] Sent: 10/18/01 7:33 AM Subject: Re: WHY EJB hi andrea, can u explain more clearly about the lack of OO principles, that u have mentioned below ????? Hi, > - Using EJB's can make it easier to enforce good OO > design principles and make the JSP that remains > better. <no-flame-please, we're just talking> For what I've seen, it is very difficult to use good OO design principles using EJBs. Take for example EntityBeans -- Everyone knows about the "value object" design pattern: if you have an Entity (a table..) with 10 fields, you have an object with 10 getter + 10 setter methods. If you try to access the data of the Entity in a naive way, *every* get and *every* set is an RMI connection. To avoid this problem, you write only one method in your Entity that gets the "value" of the Entity within only one RMI connection. How is it OO, when the platform forces architectural decisions to your application? Take for example SLSB -- Are they in _any_ way OO? They're just a collection of stateless methods, something like C... it is the opposite of OO... (OK, OK, I know, now we have EJB 2.0..) </no-flame-please, we're just talking> If we're looking into good OO design, what about JDO? > One of the knock's against JSP is that > programmers have a tendency to code business logic (or > data access, transaction mgmt, etc.) directly into the > JSP page rather than abstract it into some other > component. Using EJB's will likely reduce this > tendancy and push non-presentation logic into the > components. > It is true that most of the developers tend to write business logic in the JSP. They're but not forced to do so, it's up to them and to the application architects to manage it in another way. I think that JSPs suffer of a fundamental bad design -- they're too powerful (you can write full-fledge Java code in it) and they're too simple to use (you almost don't need to worry about compile them). However, I don't think people should use EJBs to overcome bad designs in JSPs ;-)... what an over- overkill! Bye. Andrea Vicentini __________________________________________________ Do You Yahoo!? Make a great connection at Yahoo! Personals. http://personals.yahoo.com <http://personals.yahoo.com> ======================================================================== === To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help". =========================================================================== To unsubscribe, send email to [EMAIL PROTECTED] and include in the body of the message "signoff EJB-INTEREST". For general help, send email to [EMAIL PROTECTED] and include in the body of the message "help".
