3.2. Design

The role of the BLL is to model your classes according to the business rules and processes, not necessarily the tables in the database. There is often a one-to-one relationship between a business object and a table, but the flexibility needs to be present to break from the table design and represent relationships between objects other than primary/foreign key relationships. Chapter 2 explained how the ORM Designer is used to create the entity objects that the DAL will pass back to the BLL for retrieval of data. Once you receive the entity object from the DAL, it is up to you to correctly map it to your business object. Chapter 2 also explained how to pass data to the DAL as parameters to save or delete the data from the database. Your business object may call one or more methods in the DAL depending on the business rules, and it should wrap multiple calls within a transaction. To make these ideas concrete, let's look at our example.

Create a folder called Framework in the PaidTimeOffBLL project to hold all of the classes defined in this section. The class diagram shown in Figure 3-1 displays the four base classes that you will develop in this section.

Figure 3.1. Figure 3-1

3.2.1. ENTBaseBO

The most generic type of business object is one that cannot be changed by the user. An example is a "status" object that has predefined values and specific code to handle each ...

Get ASP.NET 3.5 Enterprise Application Development with Visual Studio® 2008: 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.