Using the Microsoft C# language to create a framework of business objects in the Microsoft .NET environment is covered in this book. These objects encapsulate a number of features applicable in a distributed architecture. The framework incorporates n-level undo, tracking broken business rules, tracking whether an object’s data has changed, support for child objects, providing data binding in both Windows forms and Windows Web forms, interactions with structured query language (SQL) databases, and table-driven application security. The author designs a number of business-related classes that encapsulate the features, namely BusinessBase, BusinessCollectionBase, ReadOnlyBase, ReadOnlyCollectionBase, RulesCollection, Security.BusinessIdentity, and DataPortal. The framework is designed to provide a reusable collection of base classes, to facilitate client application access to remotely hosted database record creation, update, and deletion, with an emphasis on n-level undo capability in a Web-based .NET environment.
The first part of the book reviews the key ideas and technologies, in the context of the Microsoft .NET environment, using the Microsoft C# language, for distributed objects. The author then demonstrates how to create the designed business object framework in the .NET environment, using Microsoft Visual Studio. The framework is a redesigned version of the author’s previous book on distributed business objects, using Microsoft Visual Basic, in a component object model (COM), distributed component object model (DCOM), and COM+ environment. The author details the creation of the business object classes in the context of client side and server side, and the .NET interactions. The business objects are designed to work as distributed objects in the .NET framework, which incorporates object serialization, and encapsulates the underlying .NET object feature of remoting, namely, passing objects across a network between the client and server sides. The framework includes abstract classes that expose DataPortal methods for SQL data access. Application developers only need to override those methods required for the application to access the specific data elements.
The remainder of the book designs a sample application using the framework. The sample is based on an application to track projects and resources assigned to these projects. The application requirements are specified and refined, and an initial business object design is created. The design is refined to reduce complexity, and incorporate performance criteria. The author then proceeds to demonstrate how to use the Microsoft development tools to create the underlying database tables and SQL access scripts. The framework is then used to design the application business object classes to implement the application, with an emphasis on database access methods, which involves the creation of the DataPortal_Create, DataPortal_Fetch, DataPortal_Update, and DataPortal_Delete methods. Each method is presented and explained in detail. Since these methods are very similar, there is a considerable amount of overlap. The objects are designed to implement the business rules contained in the business requirements, and the RulesCollection classes are used to keep track of broken rules.
Once the underlying application business objects have been created, the author turns to the implementation of sample user interfaces. Sample user interfaces are created using both Windows forms and Web forms. All of the designs are developed using the Microsoft Visual Studio tools. The author then provides a sample implementation of the user interface using Web services. In each sample, consideration is given to incorporating security concerns, and examples are provided for using Windows-based security, as well as the table-driven security designed in the framework.