Chapter 5: Data Access and Security

Overview

In Chapter 4, we combined the concepts from Chapter 1, the framework design from Chapter 2, and the technologies from Chapter 3 to create about half of the CSLA .NET framework. In this chapter, we'll continue the process, completing implementation of the remaining classes. This will entail making some minor changes to some of the classes we created in Chapter 4 as well.

Specifically, we'll create the following components , as discussed in Chapter 2:

  • CSLA.Server.DataPortal.dll

  • CSLA.Server.ServicedDataPortal.dll

And we'll need to add some methods to the base classes that can interact with our data access framework:

  • BusinessBase

  • BusinessCollectionBase

  • ReadOnlyBase

  • ReadOnlyCollectionBase

Also, we'll create a host application that will run on an application server to host the server-side DataPortal components. This will be a simple ASP.NET application that's configured to act as a .NET remoting host. We'll follow the same process here that we walked through in Chapter 3 when we introduced the concept of using IIS as a remoting host.

Once we've enabled data access within the business framework, we'll employ that functionality to create our custom security infrastructure. This will include the creation of principal and identity objects as part of the .NET security framework. It will also include their integration directly into the overall DataPortal mechanism, so that our business objects can have the same security context on the application server as they do on a client workstation or a web server.

Finally, we'll close the chapter by creating a generic list class to support almost any read-only name -value list. Not only is this type of object invaluableit's used by almost every applicationbut also it will give us a glimpse into how collection objects are populated through the DataPortal mechanism.

The classes we'll create in this chapter are as follows :

  • TransactionalAttribute

  • Server.DataPortal

  • Server.ServicedDataPortal.DataPortal

  • DataPortal (client-side class)

  • Data.SafeDataReader

  • Security.Principal

  • Security.Identity

  • NameValueList

The reasoning behind each of these classes, and how they are organized into namespaces and assemblies, was covered in Chapter 2. We'll be reprising those discussions as we work our way through this chapter.



Expert C# Business Objects
Expert C# 2008 Business Objects
ISBN: 1430210192
EAN: 2147483647
Year: 2006
Pages: 111

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net