I do not understand why you still must go to the database through jdbc to
construct a 'lite' object when you could use the standard approach of
calling some bulk accessor on the entity (cmp) to return the 'lite' object
or code the session bean to create the 'lite' object from values returned by
calls on the remote interface of the entity bean. This will lead to
significant code reduction, performance improvement........
William Louth
Inprise
www.inprise.com/appserver/
> I find your TeacherLite idea very intreiguing. Are you "Lite" classes
beans
> themselves,
> or regular java objects? And do you use data classes and dependent
classes,
> or do "Lite" classes eliminate the need for such things?
>The lite classes are "regular" Java classes. In your case, you might
>define something like the following:
>1) TeacherLite, a Java class with attributes for ID, name, and other
>basic info;
>2) TeacherBean, a Java class which extends TeacherLite, implements
>EntityBean, and adds attributes such as a Vector of Credentials;
>3) TeacherHome, the home interface for TeacherBean; and
>4) Teacher, the remote interface for TeacherBean.
>Dependent classes aren't eliminated by the use of the lite class
>(Credential is a dependent class). So where do you benefit? Say that
>you want to present a list of teachers to the user for selection. You
>could do a find to locate all of the TeacherBeans and return a Vector of
>Teacher to the client. But doing this will incur a large overhead,
>particularly since every method call on the Teacher interface will a) be
>a remote method call to the server, and b) cause ejbLoad() and
>ejbStore() to be called. So what you can do instead is put a method on
>your Session Bean called, for example, getTeacherList() which returns a
>Vector of TeacherLite which the Session Bean extracts directly from the
>database. This is very low overhead, and the user can be presented with
>a quick list of the teachers; if they select a particular teacher and
>want to view that teacher's credentials, you then pass the TeacherLite
>object to the getCredentials() method of the Session Bean, and the
>Session Bean can use the lite object to look up the Teacher Entity Bean
>and get the additional information.
===========================================================================
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".