Visual C++.NET's ATL Server
See all Sams Teach Yourself on InformIT Programming Tutorials.
The Active Template Library (ATL) Server is a new technology within Visual C++ .NET not present in previous versions of Visual Studio. ATL Server is a server-based technology that runs on the Internet Information Services (IIS) Web server platform. It plays a dual role within the .NET Framework, having the ability to create Web Services, as you saw in Hour 11, "Creating Web Services," as well as Web applications, the topic of this hour.
ATL Server uses a tag-replacement methodology similar to the way ASP.NET functions. In other words, a certain tag (otherwise known as a replacement tag, consisting of a string of characters enclosed within two curly braces on each end) is encountered by the Web server (IIS), and rather than that tag being passed directly to the rendering stream, it is handed off to an extension DLL. This extension DLL then replaces the tag with its own content, which is then passed down to be rendered on the client Web browser.
In this hour you will learn:
How to create an ATL Server project and what options are available for your project
What a server response file (SRF) is and the syntax necessary to interact with your extension DLL
How to specify new replacement tags within your extension DLL and how to render to the response stream
Why ATL Server?
Before we begin our discussion on the internals of ATL Server and how to use it, you'll need an understanding of why you would want to use ATL Server in the first place. A common question being asked with this new technology involves another similar technology: ASP.NET. If both technologies involve the whole notion of "tag replacement," and ASP.NET is widely used and documented, why would someone even want to consider using ATL Server, which is still in its infancy and theoretically more difficult to use?
The whole concept of the .NET Framework involves giving you, the developer, the tools necessary to get the job done. There are some aspects of ATL Server that outweigh any advantages you would receive by using ASP.NET. However, there are also many reasons why you should choose ASP.NET over ATL Server.
Why use ATL Server? First of all, no other language within the .NET Framework can beat the performance of C++. In some instances, other languages can come close, but if you plan on writing serious CPU-intensive code, for instance, then using ATL Server within the confines of the C++ programming language will give you that extra performance boost you're looking for.
Second, ATL Server provides support for debugging and diagnostics. ATL Server, through an option when you create your project, can automatically integrate with the Performance Monitor on the server. This can give you rich information not seen by a script-driven language such as ASP. Lastly, ATL Server supports various other technologies, such as cookies, form processing, thread management, cryptography, and so on.
As you follow along in this hour, keep these issues in mind. By finding the differences and similarities between two languages, you'll be able to make better decisions down the road when it comes time to design your application.