Hi guys,
I'm currently implementing my web application's legimitation system.
On a very basic level the underlying database schema is really pretty simple: there are "users" and there are "dialogs". And because a concrete user may only access certain dialogs there is a matching m:n relationship too.
I figured, I will need at least the following methods:
1. DialogCollection GetAllDialogs()
2. DialogCollection GetEnabledDialogs()
3. DialogCollection GetValidDialogs(UserEntity currentUser)
Some explanations:
1. will get all dialogs that are stored in the database, no matter what
2. will get all dialogs that are enabled (there is a boolean field that tells if a dialog is enabled or not)
3. will get all dialogs, that are enabled and for which a given user is legitimated
There are lots of different aspx-pages that need access to these methods, so I need them on a "global application level".
First I was thinking to just create a static class and implement these methods as public methods. However, if you look at the explanations again, you will surely notice that the methods are somehow related.
For instance: if you are asking for the valid dialogs one approach could be to first get all available dialogs, then reduce this collection to the enabled ones
and finally kick all those out for which the given user is not legitimated. In other words: No. 1 would be using No. 2 would be using No. 3
So here is where I need your advice: First of all, I realize this might not be a real LLBL issue.
On the other hand I was wondering if any of you guys had a good idea on how to implement this in a clean object-oriented way...based on LLBL entities and collections.
Should I just create three classes and use one class as an input for another one?
Perhaps the whole thing can be solved way better by a common design pattern?
Unfortunately I don't have enough experience in design patterns, so I just don't see "the pattern" (if there is one).
I really hope someone can help me out here! And of course, please feel free to ask if I can provide you with more information.
By the way: my real application is a more complicated than the above. So don't you wonder why I made a mountain out of a molehill by asking for your advice on the above.
I just stripped "the real world" down a little bit so it would be easier to understand.
But having a good solution for the above, I believe I could solve the "real world" myself.
Thank you so much for any help!
Ingmar