Your example is a good one.
What if the Session bean has a method dealing with the enrollment of a
company workers group: let us say 50 workers. Would you instantiate 50
entity per "entity" or use a classical approach using JDBC directly from the
Session Bean?
Thank you.
----- Original Message -----
From: "Kjetil Paulsen" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, February 02, 2001 2:42 PM
Subject: Re: Session beans as Facade to entity beans
> > This means, all accessor methods of the entity bean have to
> > be duplicated in
> > the session bean, which I don't see much sense in (?).
>
> In the entity bean you have the data logic, in the session bean you have
> the business logic. You use the session bean to interact with the user.
> An example:
>
> SB: CourseEnrollment
> EB: Student, Enrollment, Course
>
> SessionBean have following methods:
> * enroll(studentId, courseId)
>
> this method uses the Student and Course EntityBeans to verify against
> the database that these exist and maybe gets some extra info from the
> db, then puts this in the enrollment table using the Enrollment EB.
>
> >
> > 1) What's so bad about letting the clients access the
> > entities directly?
>
> Because EBs are transactional by nature, and letting the client access
> these beans can give you unvanted (long lived) transx and locking
> behavior.
>
> > 2) Using the Facade pattern, is there any better way of providing
> > fine-grained access for the client?
>
> yeah, like mentioned above ;)
>
>
===========================================================================
> 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".