SharePoint Forums, the Domain Model

Here's the Domain Model for the SharePoint Forums Code.

SharePointForumsDomainModel_small.jpg

This was built in VS2005, but there are some difficulties with the class diagram. All the collections are strongly typed, yet if you try to connect say a property called Messages (from the Topic class) to the MessagesCollection, the designer complains that it's a weakly typed collection. So in some cases it's an assocation, in others it's an association shown as a collection (when the designer decided that it was okay).

The RepositoryRegistry is a class that handles access to all the Repository classes. The various domain entities (Forum, Topic, Category, Message) are shown with their associations. The Repository classes are access points for the Web Part class (not shown) to access the list data (through a data access service that lives in the Common assembly). The Mapper classes translate domain objects to list structures (and vice-versa). The ListBuilder (and various builders) along with the ListDirector implement the Builder pattern that create the lists (if needed) on startup.

There are no SharePoint objects here (except a reference to the SPUser class in the ForumUser class through a property called UserDetails, which lets me not have to duplicate things like email addresses and display names) and everything SharePoint is either in the Web Part class or the Data Access Layer.

There are a few base abstract classes or interfaces that could be added here (now that I look at the design from this viewpoint) like creating a base Mapper, Dao, and Repository class or interface.

I haven't uploaded the code yet as I'm trying to figure out how to do this with Team Explorer. Team Explorer lives inside Visual Studio 2005. Unfortunately the forums are still a 1.1 project and I really don't want to create a fork just to upload the files to the server so trying to figure out the command line tools to check the code in to CodePlex.

Feel free to comment on or ask questions about choices I made in the domain. It's pretty clean overall and well positioned for testing (there are about 80 unit tests in the system) as well as being loosely coupled and easy to add new features.

No Comments