Welcome Guest, Not a member yet? Register   Sign In
The best way to handle conditions?
#1

[eluser]codex[/eluser]
I'm working on an app that has 'groups'. A group can be private or public and a group has different levels of membership. For instance, the group admin can decide who can post, if it's even possible to post etc. But I'm struggling with the best way to handle all the conditions. I now have all conditions in the group class constructor, and depending on the settings the user should be routed to the correct method. The code is rather messy and it doesn't work well. I'm thinking there may be a better way that I'm just not seeing.

Does anyone have an idea, or better, a small piece of sample code for inspiration on how to handle groups and conditions?




Theme © iAndrew 2016 - Forum software by © MyBB