Viewing entries in the tag "design patterns". Show all entries

From Zero To Launch - Part III: Reusable Web Controls

18 05 2008

This is the third post in a series of entries that I am using to describe the architecture used in my most recent social networking project. While some of the architecture is omitted from these discussions, I would like to share some of the tricks that my team used to decrease development time and meet the rough and ambitious deadlines that were placed upon us. This entry will continue the discussion on web controls with an emphasis on distinguishing between server and user controls.

During the domain modeling phase of the application, we noticed that Comments were utilized by several different areas of the application:

The first piece of the application to utilize the control was the User profile. As mentioned in the previous post, we constructed useful server controls to facilitate a consistent layout throughout the application. Using one of these controls, the LayoutModule, we constructed what we referred to as a CommentContainer to display comments.

As we expanded the functionality of the control, we realized we needed/wanted two things:

  1. AJAX comment posting, deleting
  2. Pagination

In order to allow for this functionality, we needed to abstract out the functionality that was required using a variation of the Bridge pattern:

Note: The CommentProvider is an extension of a generic EntityProvider that is used to define the general functionality shared by all of the controls that utilize this pattern.

After the CommentContainer and CommentProvider were finalized, adding comment functionality for additional pages was a piece of cake and the code is very easy to maintain.

kick it on DotNetKicks.com

Comments 3 Comments