What I have:
I am developing an Active Directory layer which will be used by a huge application with several modules having several solutions and projects...
I am fairly new to developing large scale solutions.
Because the current requirements are mostly to deal with User and Group objects in AD, my current solution looks like this,
System.DirectoryServices.AccountManagement.UserPrincipalto add custom attributes and override
GroupPrincipalExtension(same as above but with
- Models (models have override methods, e.g.
toString, constructors etc.)
- and so on...
- ADUserRepo (CRUD for user, + isUserInGroup sort of methods)
- ADGroupRepo (CRUD for group, + GetUsersInGroup sort of methods)
- Utilies (Get Context, etc..)
What I want OR confusion is at:
Because some methods are sort of common between User and Group Repositories, Would it be any beneficial to move all methods out of
GroupRepo into a single
DirectoryRepo class and delete these repositories ?
At the moment this is creating confusion for me who is developing this, but it may confuse or either FORCE a consumer of this code to add duplicate methods.
How can I overcome this problem?
I named these repositories but these are just static methods accessing AD, sorry if that created any confusion.
Here are few of my previous questions on SO, if you want to look at some of the related code