Roles design

Hello everyone,

I am trying to find out what would be a good design to deal with roles.

What i have got so far is something like this:

- User class. Thisclass contains the information about the user (name, address...) and a List with the roles he can use.

- RoleFactory. Here i have implemented Factory Method (i think). Theclass returns a WriterRole or an EditorRole based on a parameter.

- IRole interface. Here is my main problem...i can磘 really think whatthisinterface should declare, here is where i am stuck.

- WriterRole and EditorRole. Both concrete classes thatimplements the IRoleinterface

Could someone help me if i am in the right track, and any tip in what IRole interface should declare?

I don磘 know if it is ok (if it isn磘, sorry), but here is a link to another post i wrote where you can see the code i got so far (it was really helpful, but i am still stuck):

http://forum.java.sun.com/thread.jspa?threadID=679723

Thanks in advance,

Regards

[1234 byte] By [didia] at [2007-10-2 6:48:45]
«« url to ip
»» e-mail
# 1
I forgot to tell you that i checked the Martin Fowler "Dealing with Roles" and also was helpful to me, i also searched the forum for information.
didia at 2007-7-16 13:57:34 > top of Java-index,Other Topics,Patterns & OO Design...
# 2
http://www.martinfowler.com/apsupp/roles.pdf http://www.jot.fm/issues/issue_2002_09/column2 http://st-www.cs.uiuc.edu/users/hanmer/PLoP-97/Proceedings/riehle.pdf
mchan0a at 2007-7-16 13:57:34 > top of Java-index,Other Topics,Patterns & OO Design...