Why No Variables?


Why No Variables ?

At this point youre probably wondering where the variables are. Static parameters are useful, but what happens when you want to have dynamic parameters and other variables for storing things like user input? Well, the short answer is that ATL Server doesnt provide variables. Again, the model is extensible so you can add variables if you so desire , but you would have to do a lot of work and you would detract from some of the advantages of ATL Server.

Advantages of ATL Server

The first advantage of ATL Server is its performance. Because there are no variables in SRF files, and there are certain structural rules (e.g., handlers must appear as the first tags), the stencil processor needs to parse an SRF file only once. Thus, it parses the file while generating the HTML stream to be sent to the client. This process is extremely efficient and doesnt suffer from the big performance problems of systems that require multiple parses of the dynamic HTML file in order to render the static page to send back to the client. SRF files are basically as static as dynamic files can be (in terms of performance).

The second advantage relates to the issue of where your application logic is going to reside. ATL Server is designed for high-end Web applications. In this situation, you want your application logic where your best developers are (in your C++ shop). The emphasis is on having all the application logic go into the code and only layouts go into the SRF files. There are a number of major advantages to this, especially as your Web application begins to grow. Although scripting languages and other Web languages can appear powerful at first, they can quickly pull developers into a trap. Their syntax, though often friendly for rapid development, can be difficult to read ( especially when its nested within complex layout logic). On top of this problem, tasks such as debugging the application become an absolute nightmare, not to mention the loss of some of the foundations of object-oriented programming such as code reuse.

The ATL Server team ran into countless examples of large Web applications built with the application logic within the Web pages themselves . In all these cases, the development teams had lost the ability to maintain many of the complex pages in these applications. Beyond this, the teams had often become afraid of even touching some of the pages for fear of breaking their applications. The teams decided that they wanted to make it as difficult as possible for ATL Server users to fall into this trap of choosing small short-term gains that cause large long- term problems.

Because of this decision, it didnt make sense to provide support for variables in the SRF file. Not only does this help you provide your pages with high performance, but it also makes sure that you keep your application logic where it belongs: in the code!




ATL Server. High Performance C++ on. NET
Observing the User Experience: A Practitioners Guide to User Research
ISBN: B006Z372QQ
EAN: 2147483647
Year: 2002
Pages: 181

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