5.2. Design

Instead of talking about the membership code we just wrote, let's add some new functionality and use the new validation design. One of the requirements is the ability for the users to create a new message, so let's start with that.

First, we should understand what a message is made up of:

  • A descriptive name, for example, October Newsletter

  • An email subject, for example, "October's exclusive offers to our valued members"

  • Message content in HTML

  • Message content in plaintext

The name, subject, and text body are required, whereas the HTML body is optional. Figure 5-1 shows the class diagram for the model.

Figure 5-1. Figure 5-1

For the sake of this chapter, we are only concerned with the message creation operation and not the process itself. This will make it clearer to talk about validation without getting bogged down in the process details.

Get ASP.NET MVC 1.0 Test Driven Development: Problem - Design - Solution now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.