--- Stefan Holdermans <[EMAIL PROTECTED]> wrote: > But --- and this what I'm struggling with --- the junior-users and > senior-users group will need a special treatment: they're system group and > the app should not allow them to be removed. How will I implement that? > Should I hardcode these restrictions in the Entity Layer. Should there be an > extra column in the UserGroup table that indicates whether a group is a > system group?
Put a column in your data that says if it is removable. I would almost always avoid hard coding this type of information. In general I prefer 'data driven' solutions over code driven, whether the table is pulled from a database or is compiled in. All other things equal it allows for more maintainable code. Say you change the name or id of one of your groups in future (internationalisation being a possibility), do you want to revisit code, where logic is often distributed, and certainly interweaved with other functionality/logic? Or change data in a table, where is is centralised and clear (assuming the data is normalised appropriately ;-) )? A table is always going to be more readable and easy to change. Further, so long as you know your code works for the flag, you know it will work when you change things - you don't need to re-verify your code. Peter __________________________________________________ Do You Yahoo!? Sign up for SBC Yahoo! Dial - First Month Free http://sbc.yahoo.com You can read messages from the Advanced DOTNET archive, unsubscribe from Advanced DOTNET, or subscribe to other DevelopMentor lists at http://discuss.develop.com.