Building a Module for Sitefinity (part 5) : Module structure

Posted on May 16, 2007. Filed under: Building a pluggable module, Projects |

The Contacts pluggable module will be made of two assemblies : Sample.Contacts and Sample.Contacts.Data

The business logic and UI will be implemented in Sample.Contacts module, while the data access we’ll be done through the Sample.Contacts.Data assembly. Take a look at the following diagram to see the big picture :

Contacts module diagram

Sample.Contacts assembly

There are five main parts of this assembly :

  • Web controlsAdmin web controls that will provide a way for authorized users to work with contacts and Public controls that will display the contacts on the pages.
  • Contacts Manager – Web controls will work exclusively with Contacts Manager when manipulating data.
  • Contacts ProviderContacts manager will call the methods inside of a provider class. Since there can be more than one provider (Sql and XML for example) the Contacts Provider is an abstract class that the actual provider classes need to derive from. In addition to this, the Contacts Provider class will be used to retrieve various settings from web.config used by the module (like paths to external templates and such).
  • Both, Contacts Manager and Contacts Provider classes will get the needed settings from web.config by using Configuration classes.
  • Finally, we have Resources where all the messages and labels will be stored in case we decide to localize our module at later stage.

Sample.Contacts.Data assembly

There are four main parts of this assembly :

  • Contact (dbclass) – Nolics class that will define the database object for storing contacts and it’s Contact partial class that we’ll use to add some additional functionality
  • Department (dbclass) – Nolics class that will define the database object for storing departments and it’s Department partial class that we’ll use to add some additional functionality
  • Default Provider – This class derives from Contacts Provider abstract class and will actually implement all the data manipulation methods (such as inserting a new job, deleting a department etc.)
  • Resources – here mostly to hold error and exception messages in case we decide to localize the application at later stage

In the next post I’ll provide the link for the latest version of the project and describe briefly what’s been done. If you have qustions or suggestions, don’t hesitate to leave the comment 🙂

Advertisements

Make a Comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Liked it here?
Why not try sites on the blogroll...

%d bloggers like this: