Hi,

The service facade supply transactional methods.
Each method of the service layer execute an atomic business transaction on
the server.

A service facade do **not** have to provide all the setters and getters from
all the entities, but coarse grained methods which represent business
transactions.
The method granularity of the service facade is dependent of the Use Case of
your system.

Example:
        You have a Student Enrollement and Course entities.
        The session facade may looks like:

        public interface CourseEnrollementUseCase {
                public Enrollment enroll(String studentId, Course
courseId)...;
                public void unenroll(String studentId, Course courseId)...;
                public void unenroll(String enrollmentId)...;
                public EnrollmentStateHolder getEnrollmentStateHolder(String
enrollmentId)...;
                public void setEnrollmentStateHolder(String enrollmentId,
EnrollmentStateHolder sh)...;

                // return a collection of EnrollementStateHolder
                public Collection getStudentEnrollments(String
studentId)...;
        }

        Usually, the service facade do not supply fine grained entity
accessors.
        The service methods can be write using entities, or direct JDBC
calls if the entity
        overhead is too high.

        To control concurrency, the StateHolder object must use optimistic
locking.
        Overuse of pessimistic locking is a performance botteneck for
distributed systems.

Tibo
[cut to save a few bytes...]

===========================================================================
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".

Reply via email to