No .. In your example, person bean would use factory class ; which depending
upon the type of "person" and method , would return one of the subclasses .

i.e For manager type , in manage method , it will return Manager bean , for
other type , it will throw "NoMethodSupported" exception in this method.

(I had used this in WebObjects ; but probably that would not make in
difference
in design pattern,)

Regards,
Amit

On Sun, 13 Aug 2000 14:27:35 GMT, Tom Lepski <[EMAIL PROTECTED]> wrote:

>Hi Amit,
>Could you please give some details about how your factory class works? Do
>you mean to say that on the client side you get references to Subclass
>beans
>by using the Factory?
>
>thanks,
>Tom.
>
>
>>Hi ,
>>
>>I had implemeted this similar to what tom had suggested.
>>Only thing is I was using factory class which will return the correct
>>class
>>(one
>>of the sub-classes ) depending upon the tag value ; This allows to add
>>more
>>sub-classes without making any change in the parent class .
>>
>>Regards,
>>
>>Amit
>>
>>On Tue, 8 Aug 2000 14:14:41 GMT, Tom Lepski <[EMAIL PROTECTED]> wrote:
>>
>>>Hi Kurt,
>>>I understand your Collection analogy but I think this is really a
>>>legitmate
>>>demand. For eg. in a system there could be Persons, Managers and
>>>Techleads.
>>>Now, it is quite reasonable to retrieve all the Persons in one go and
>>>then
>>>depending on the person perform activities. So there have to be different
>>>entities because operations like manage() cannot be provided in Person
>>>bean.
>>>
>>>But as I write this, I got another idea.
>>>Support all the methods in Person (actually have just one kind of entity
>>>bean which has superset of all the attributes) and also have a tag field
>>>telling whether it is a Person or Manager etc. Now depending on this tag,
>>>call the appropriate methods. If you call manage() on a bean that has the
>>>tag value of Person, throw some runtime exception!
>>>
>>>Please give your comments on this. I am sure many of the projects
>>>involving
>>>EJBs must have ran into this kind of situation.
>>>
>>>Please help,
>>>-Tom.
>>>

________________________________________________________________________
Get Your Private, Free E-mail from MSN Hotmail at http://www.hotmail.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".

Reply via email to