On Mon, Aug 25, 2008 at 10:21 PM, Jonathan Hall <[EMAIL PROTECTED]> wrote:
> > I have found a couple of RIAForge projects very helpful in grasping this > sort of design. At the simplest level I will take each of my DB tables and > create a Bean/DAO/Service for them, this isn't always 100% how it will work, > but starting it it really helped me grasp this design pattern. > I'd warn people off doing this blindly. If you aren't careful, having your database dictate your object model is a pretty good way to end up with a procedural model that has all of the complexity of OOP with none of the benefits. > > As for your UserBean & AdministratorBean if those are 2 seperate objects, > you would most likely have 2 seperate DAO's. But additionally wouldn't an > Admin be a User with elevated access? > > Maybe think of it like you would have a CompanyBean/DAO/Service which then > has a UserBean/DAO/Service and those Users could be > admins/superusers/regular users. > I'm not sure what the idea for the AdministratorBean is. I'd also drop the "Bean" part of the name. Bean is just a pattern that states how properties should be exposed. It sounds like what is going on here is that a User has-a Role. To hardcode this to "Administrator" will result in brittle code. It's better to design to an abstraction such as "Role", which gives the flexibility to have many roles. --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "CFCDev" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfcdev?hl=en -~----------~----~----~----~------~----~------~--~---
