- Table of Contents
- Copyright
- About the Authors
- About the Contributors
- Acknowledgments
- Tell Us What You Think!
- Introduction
- How to Use This Book
- What You Need to Use This Book
- What's New in Visual C++ 6.0
- Contacting the Main Author
- Part I: Introduction
- Chapter 1. The Visual C++ 6.0 Environment
- Part II: MFC Programming
- Chapter 2. MFC Class Library Overview
- Chapter 3. MFC Message Handling Mechanism
- Chapter 4. The Document View Architecture
- Chapter 5. Creating and Using Dialog Boxes
- Chapter 6. Working with Device Contexts and GDI Objects
- Chapter 7. Creating and Using Property Sheets
- Chapter 8. Working with the File System
- Chapter 9. Using Serialization with File and Archive Objects
- Part III: Internet Programming with MFC
- Chapter 10. MFC and the Internet Server API (ISAPI)
- Chapter 11. The WinInet API
- Chapter 12. MFC HTML Support
- Part IV: Advanced Programming Topics
- Chapter 13. Using the Standard C++ Library
- Chapter 14. Error Detection and Exception Handling Techniques
- Chapter 15. Debugging and Profiling Strategies
- Chapter 16. Multithreading
- Chapter 17. Using Scripting and Other Tools to Automate the Visual C++ IDE
- Part V: Database Programming
- Chapter 18. Creating Custom AppWizards
- Chapter 19. Database Overview
- Chapter 20. ODBC Programming
- Chapter 21. MFC Database Classes
- Chapter 22. Using OLE DB
- Chapter 23. Programming with ADO
- Part VI: MFC Support for COM and ActiveX
- Chapter 24. Overview of COM and Active Technologies
- Chapter 25. Active Documents
- Chapter 26. Active Containers
- Chapter 27. Active Servers
- Active Servers Introduction
- Three-Tier Development Using Server Components
- MFC Versus Active Template Libraries
- Designing an MFC Miniserver
- Designing an MFC Automation Server
- Summary
- Chapter 28. ActiveX Controls
- Part VII: Using the Active Template Library
- Chapter 29. ATL Architecture
- Chapter 30. Creating COM Objects Using ATL
- Chapter 31. Creating ActiveX Controls Using ATL
- Chapter 32. Using ATL to Create MTS and COM+ Components
- Part VIII: Finishing Touches
- Chapter 33. Adding Windows Help
- Part IX: Appendix
Three-Tier Development Using Server Components
Traditionally, when we refer to the term client/server, we are talking about an application that runs on a PC and connects to a database running on a server somewhere. This is fine for small- to medium-size businesses with anywhere from 5 to 50 users. However, it really becomes a hassle when you have 500 or more users. Every time a fix is made to an existing application, you need to distribute the new application to every desktop and ensure that it is installed properly. This process is both time-consuming and costly as far as ensuring software and component compatibility on all desktops.
What about Internet and intranet applications? These need to be browser-based applications, but if you attempt to service thousands of users with simple common gateway interface (CGI) scripts, you end up spending a lot of time making sure that you're not getting deadlocks on files or databases.
The first network-aware COM or OLE technology introduced by Microsoft was called remote automation. Basically, remote automation permits an application running on PC 1 to connect to and create automation objects on PC 2.
The big problem with remote automation was that as a Visual Basic–centric technology, it didn't have any security, it didn't have any sort of pooling strategy to manage resources or database connections, and it was never designed to be used with the Internet or intranets.
Microsoft later released distributed COM (DCOM), which improves on the distributed aspect of COM objects, including support for Internet and intranet applications, and has a fully defined security model.
The next major distributed technology milestone for Microsoft was the release of the Microsoft Transaction Server (MTS). Not only does MTS address all of the problems mentioned earlier, but it also supports transaction processing.
Let's look at an example of how MTS could be useful. Given a bank account number, you could build two MTS components: one that performs a debit and the second that performs a credit. Now all you need to do is tell MTS about these two components (ingrain that word components into your brain) by installing them on the server that is running MTS instead of on the client workstation.
You now need to do little more than write a small applet that is integrated with the MTS server and starts a transaction, calls the debit component, calls the credit component, and completes. It is now MTS's responsibility to commit the processing steps these two components performed. If either of the components fails, MTS rolls back the transaction. Windows 2000 integrates the features of MTS into the operating system as part of COM+. COM+ and MTS are discussed in more detail in Chapter 32, "Using ATL to Create MTS and COM+ Components."
The point is, we're moving away from the client/server (two-tier) way of thinking. Instead, we're moving to a three-tier model, where the client application is very thin (commonly called a thin client), because it only has the minimal functionality of calling these automation servers and displaying results for the user (which can be done by a thin-client application or through a Web browser). The second tier is where the bulk of the work is done. It's an application server with hundreds—even thousands—of these tiny components installed. The third tier is the database tier.
MFC Versus Active Template Libraries | Next Section

Account Sign In
View your cart