ASP - What,Where,When and Why
One of my roles as a Maxim Group Consultant is to conduct phone interviews with potential consultants and try, in a brief conversation, to evaluate their technical level of expertise. I try to keep the conversation centered around projects that they have worked on and the level of their involvement in those projects.One of my roles as a Maxim Group Consultant is to conduct phone interviews with potential consultants and try, in a brief conversation, to evaluate their technical level of expertise. I try to keep the conversation centered around projects that they have worked on and the level of their involvement in those projects.
You would probably be surprised to know that a large portion of Web Developers that I run into do not have the proper answers to the questions raised in the title of this article. A lot of Developers that I have talked with and interviewed look at ASP as a way of replacing client-side script, and consider that the only benefit of ASP is the ability to hide and protect your code! "If I need to access a database - I'll use a CGI!" is a quote I hear often.
What is ASP? - This seems like a simple question, but the
answer is a little more complex. Active Server Pages are a form of
technology which allows scripting processes to take place on the web server
prior to any HTML being deleivered to the client.
This is a pretty simple, literal definition, but a lot of people miss the most important part of this statement: the processing takes place prior to any HTML being delivered to the client! This tells us that ASP is not interactive like client side scripting but more like a form of batch processing. ASP started out very simplistic in capabilities with the major benefits being the ability to control the flow of HTML output very similarly to that of a program using control statements such as FOR---NEXT, IF--THEN, etc. For those of us used to using straight HTML this was a huge step forward. Similarly, the 5 intrinsic objects to ASP - Response, Request, Session, Server, and Application gave us functionality such as the ability to persist variable values through multiple pages, access server variables, redirect a user to a different page if certain conditions are met, etc.
I personally was in heaven! I could put together pretty impressive pages in a short period of time that actually did more than just look good, but actually served a function! A simple example is placing an HTML form to get a user name and password, use ASP to verify and if verified place a Session variable to TRUE, then in key areas of my site I test that Session variable and if it is false then I redirect them to a login page.
Once I learned how to use Objects and custom components inside of ASP then the applications started flowing. Now, the Intranet I work on truly molded from a static, HTML with Links type site to a site that houses over 15 database applications using ASP and a few Visual Basic CGI's.
One last note on what ASP is - by being a Server Side technology it is completely Browser independent, if your Server supports ASP then all you have to do is to make sure that any HTML generated by your script is compatible with the browsers you support.
Why ASP? ASP fits all of the criteria for today's latest thoughts on application development. It supports a wide variety of thin clients, it is multi-tiered, and it allows for Rapid Application Development. ASP gives Web Site Developers an easy to learn tool for adding functionality to sites that would otherwise just provide presentation with no actual function. Most importantly, at least to Corporate America, ASP applications are relatively inexpensive to develop and deploy.
Where and When? ASP is ideally suited for instances where a small amount of code is needed to perform a single function or one of a small number of functions. Because ASP is interpreted and not compiled, it has to check each line of code as it steps through it. This means that the larger the code, the slower the page loads. This also means that it is very difficult to implement extremely thorough error checking and therefore should be used when the task to be performed is relatively simple or not very error-prone. I am sure there are developers that will disagree with me and I have seen some very large ASP source code files that perform some very complex operations, however it is important to remember that in determining the architecture and technologies for any application, there is often trade-offs. In a large ASP file you are trading ease-of-development for performance.
Conclusions: ASP is a very powerful, easy to learn technology used to put functionality into your web pages and to provide a method of launching thin-client applications. Remeber to keep in focus the differences between client and server side processing and the advantages and pitfalls of each. ASP is best when used for single, non-complex tasks in an environment requiring a small amount of code.