Maybe you can point me to where the EJB spec says, for which problems
you should use EJB and for which you should not.
The problem that I presented could be implemented as a shared object
if both threads and the object live in the same JVM.
It also could be implemented as a Server being contacted by RMI, or CORBA
object,
etc, and all the common design patterns could be used.
Don't think of it as class Complex; think of it as a plain server that you
designed providing service via RMI, or some other kind of service object.
It is not a too big stretch to take a "service" class and make it into a
EJBService.
You need to give me stronger reason why something that can be implemented
using
by many other paradigms cannot be implemented by EJB's.



----- Original Message -----
From: Rickard �berg <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, March 16, 2000 10:36 PM
Subject: Re: having a PRIVATE synchronized method in a session EJB


> I think I have identified your problem.
>
> > I believe, I do need the synchronized capability not only for private
case
> > but also for public methods in session EJB.
> > I created an "almost real life" scenario that illustrates the need for
synch
> > capability.
> > You can read the code but here summary.
> > I have a designed a class  (Complex) that was to be used by multiple
> > threads.
> > The class Complex has own variables, which are not stored in database.
> > I have two threads that theoretically could be on different machines and
> > know nothing about each other.
> > Consequently, I implemented "set"  and "print" methods with synch.
> > If I did not, I could get inconsistent results.
> >
> > Now my boss came to me and said that she wants the class to be
implemented
> > as EJB service.
>
> Here's your problem. Your boss "told you so". Yeah. Right.
>
> Look, your code is not at all suited as an EJB. I would imagine that
> Complex objects could be *used* by EJB's, but it should not be an EJB by
> itself.
>
> What is the reason you want it as an EJB? What does it solve that it
> doesn't solve on its own?
>
> /Rickard
>
> --
> Rickard �berg
>
> @home: +46 13 177937
> Email: [EMAIL PROTECTED]
> http://www.dreambean.com
> Question reality
>
>
===========================================================================
> 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".

Reply via email to