Hi everyone,

this shouldn't really be a matter of patterns but that's it, here it is anyway...

Basically I have the following users hierarchy:

pubilc class User{
String username;
String passwd;
//...other attributes common to all the types
}

public class Customer extends User{
...
}
public class Guest extends User{
...
}

Persisted with OJB.

the point is that i'm trying to build an EJB to give an as much unified as possible 
interface to these VOs; the problem is that until now I didn't come up with anything 
that satisfies me.
I don't know if it's better to add an attribute like User.type, so that I can handle 
the subclasses in a sort of facade.

The point is that at least with the getters I am forced to have 

getUser()
getCustomer()
getGuest()

since they must return the proper type.

I guess this is a common issue, so, any idea?!

thanks all,
villo

View the original post : 
http://www.jboss.org/index.html?module=bb&op=viewtopic&p=3850425#3850425

Reply to the post : 
http://www.jboss.org/index.html?module=bb&op=posting&mode=reply&p=3850425


-------------------------------------------------------
This SF.net email is sponsored by: IT Product Guide on ITManagersJournal
Use IT products in your business? Tell us what you think of them. Give us
Your Opinions, Get Free ThinkGeek Gift Certificates! Click to find out more
http://productguide.itmanagersjournal.com/guidepromo.tmpl
_______________________________________________
JBoss-user mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/jboss-user

Reply via email to