5
Chapter 1: A Framework for Enterprise Applications
always better to rely on the application to let you know when an exception occurs, rather than the user.
This not only helps in the debugging process, but also makes you look like a more proactive developer.
This chapter reviews the Microsoft Exception Handling Application Block, which I use in all my appli-
cations for exception handling. The set of classes it provides include logging and e-mailing capabilities,
depending on the type of exception, and it is completely configurable.
Chapter 6: Role-Based Security
Most business applications require role-based security. The business owner of an application usu-
ally wants certain groups to have full control of all screens, other groups to have full control of a few
screens, and another group to have read-only access to a few screens. This chapter demonstrates a
pattern for creating roles in a system and associating capabilities with those roles. Access can be cat-
egorized as “none,” “read only,” or “edit,” and can optionally be associated with an item on a menu that
should or should not be shown to the user. Users are then associated with one or many roles. This pat-
tern enables business owners to administer their own applications and not rely on IT or you to set up
users and roles after you release your application to production.
Chapter 7: The Workflow Engine
Simple workflows such as a request for vacation and a manager’s approval make up a large percentage of
corporate applications. Microsoft developed the Windows Workflow Foundation (WWF) to specifically
address this issue in order to give developers a foundation they can build upon in their own applications.
Learning the WWF would require much more than a chapter in a book, but in this chapter you will learn
a pattern you can use in your own applications, one that is simple to incorporate with a few tables and
classes. You could use this pattern for applications that have any type of workflow with multiple states.
Examples of such applications are approvals for vacation time, travel, network access, or even an issue-
tracking system.
Chapter 8: Notifications
Automated notifications can make a big difference in the value of an application, especially in a
workflow-driven application. Systems should proactively notify users when a request is sent for their
approval or their request is approved, denied, or unattended to for a certain length of time. In this chap-
ter you will learn to build a Windows service application that monitors activity and sends e-mails to
appropriate users based on events within the system. This not only exposes users to a notification ser-
vice pattern, but also introduces building, debugging, and installing Windows services.
Chapter 9: Reporting
The free Crystal Reports for .NET objects that come with Visual Studio are very powerful and can
add a professional look and feel to your application. This chapter explains how to incorporate the
Crystal Report objects for .NET to display your data in HTML, PDF, Excel, or Word. Again, a middle-
tier pattern serves as the “brains” for fetching and manipulating the data before passing it to the user
interface, where a Crystal Report object simply takes the data that was delivered and formats it as appro-
priate. This pattern enables you to reuse middle-tier objects for multiple report views and shows you
how to dynamically set groups, or display headers, footers, or detail lines in the report.
96865c01.indd 5 12/17/08 2:06:02 PM