Where is the Business Logic?

In a Windows DNA application, the objects on the business-services tier execute business logic, the combination of validation, logon verifications, database actions, and algorithmic transformations that model an enterprise's way of doing business. In this sense, the PT Admin application performs minimal business logic, which consists mainly of retrievals and write operations on database tables. The COM components in the business-services tier prepare the data for display and ensure that it is formatted correctly for storage in the database, but they do not enforce business rules in the strictest sense.

Two recurring themes in the application, XML and localization, are the focus of the business-services tier. The Lingo component transforms XML files into HTML files to present localized user interfaces on the fly. The Formats component (implemented in NLS.dll) ensures that data from different locales appears correctly and is stored correctly. The SQLXML component transforms data retrieved from the database into the XML stream that is data-bound by the XML Data Source Object embedded in the application's HTML pages. This part of the architecture adheres most closely to Windows DNA principles, even though it does not strictly implement what would be considered business logic in more rigid architectures. (See Binding XML Data to HTML Pages with the XML Data Source Object for a discussion of the XML DSO in the architecture of the PT Admin application.)

You should not interpret the LitWare team's decision not to use COM components to implement traditional business logic as a recommendation. The BDG is, among other things, a teaching vehicle. Other BDG scenarios focus more closely on business logic; Scenario 3 concentrates on other areas equally important to the Windows DNA model, such as implementing XML technology to handle data flow among application tiers. You will probably develop many applications that require the advantages that implementing business logic in a COM layer provide.

For a discussion of the benefits and drawbacks of designing COM objects in this way, see Components Designed for Reuse.

For a discussion of the PT Admin application's COM components, see Components in NLS.dll and Litware.dll.