GeekDork.com - work smarter not harder

Building a better web application - The CAP method: Introduction

Sections:
  1. Introduction
  2. History & How it works
  3. Skeleton Properties
  4. Site Construction
  5. Implementation
  6. 'Common Members'
  7. Issues & Conclusion

Download WebSkeleton

Target Audience:

This discussion is directed towards more advanced ASP.net developers who have a solid understanding of object-oriented concepts and constructing ASP.net applications. Sample code is presented in VB.net.

A few notes regarding the terminology in this discussion:

Skeleton*: This is the term that I have adopted to represent what most people call a "template". I have also heard it called "Chrome". What it represents is all of the common visual components of a web application. To use a simple example, consider the typical web application layout: Header (or banner), side navigation (left, right or both), content area and footer (copyright, text nav, etc). I consider the Skeleton of the application to be everything except the actual content. Each individual page dictates what will be in the content. Everything else is the Skeleton. Every page typically uses it. Provisions can be made in the design of the Skeleton to be able to "turn off" bits and pieces of it if a particular page doesn't want them.

WebSkeleton: This is the core technology created to facilitate the construction and maintenance of a typical web application. It comes in the form of a .net assembly: "GeekDork.WebSkeleton.dll". To use it, you simply need to include it as a file in your web application and add a .net reference to that file in your web project.

* I would have used "Framework" but that would be too easily confused with .net's "framework".

A note regarding MasterPages:

If you have looked at any of the documentation or articles regarding ASP.net 2.0 you may have heard about master pages. (They do already exist but will be a native part of the next ASP.net release.) I've read up on them and it seems that they do just about everything that WebSkeleton does. I am personally very excited to try out the MasterPages functionality of ASP.net 2.0, though slightly bitter that all my work on WebSkeleton will be obsolete. The positive side to all this is that A) ASP.net 2.0 isn't out in a production release yet, and won't be for some time and B) writing WebSkeleton has given me a much better understanding of how the pages work and what methods can be used to push them to do what I would like. I plan on using WebSkeleton in my own applications until I have had a chance to test and prove that MasterPages will be able to to what I need. Oddly enough the methods I came up with for using WebSkeleton are somewhat similar to the way the final master pages will work. The syntax in the HTML markup is somewhat the same and will require little syntax change.

Despite the likelihood that MasterPages will make WebSkeleton obsolete, some of the techniques in the latter part of this article will still be applicable to web application construction even in ASP.net 2.0. I'd recommend reading those sections even if you have no intention of ever using WebSkeleton as it may be useful to implement those techniques in any ASP.net application. Take a look at the CommonMembers section.

The CAP method

What is the CAP method?

CAP stands for:

Core: The WebSkeleton assembly provides the basic infrastructure for building WebForm and UserControl classes.
Application: An application contains base classes for its instances of WebForm and UserControl classes. These classes are derived from the WebSkeleton classes.
Page: Individual WebForm and UserControl classes are derived from the respective application base classes.

Why use the CAP method?

Using the CAP method enables a web application architect to provide common functionality and members to an entire application in a simple, straightforward and easily accessible fashion. It also provides the architect with the capability to create an application Skeleton for visual consistency and ease of maintenance. It greatly simplifies and reduces the code necessary to add new pages to an application and perform maintenance or enhancements.


Proceed to: History & How it works

Note: This article applies to WebSkeleton version 1.0. Please see the release notes for updates.




GeekDork.com - Contact Us
This site is optimized for Internet Explorer.