Designing the Interface and More for an Online E-Mail System in ASP.NET 2.0
(Page 1 of 5 )
Picking up from where we left off last time, we're going to start developing the components that we will need for our integrated online email system. We will start with designing the interface, then move on to the data tier.
A
downloadable .rar file is available for this article.
Labor over the Solution
From now on, we are going to explore how to develop each basic component that constitutes an integrated online e-mail system.
Designing the Interface
To enhance the extensibility and flexibility of this system, we've designed two interfaces: IFolder and IMail.
1. IFolder Interface
This interface declares the basic methods associated with folders, such as the method GetFolders for getting information about all mailboxes, the method NewFolder for creating a new mailbox, and so forth. The following Figure 3 gives us the class diagram of the IFolder interface.
Figure 3-the class diagram of the IFolder interface

As is shown in Figure 3, we encapsulate all the basic mailbox operation-related declarations into a single interface, which is a good practice in real life. Moreover, below the IFolder interface, we've defined a Folder class which is derived from the abstract IFolder interface to implement all the methods declared in its parent. Since all the modules are small and basic, and even self-explanatory, we do not explain too much about them here. We'll clarify some of them in the next section and in later use.
2. IMail Interface
Compared to the IFolder interface declared above, this interface is more important, because it encapsulates nearly all the underlying operations relevant to e-mail, i.e. getting and modifying the system profile information, obtaining all the e-mail messages or those from single mailbox, sending e-mail, adding the e-mail sent to the mailbox, adding the e-mail's attachments, moving/deleting e-mail, and fetching the e-mail's attachments. That's 11 function in all. Figure 4 below gives you a more descriptive and clearer approach; it is the class diagram for the IMail interface.
Figure 4-the class diagram for the IMail interface

Seen from the figure, a new class derived from the parent IMail interface, namely Mail, is also defined. Mail is responsible for implementing all the related methods declared in its abstract parent interface. We choose not to talk about it much here, and to let the practical examples later explain everything.
Next: Designing the Data Tier >>
More ASP.NET Articles
More By Xianzhong Zhu