- ASP.NET 3.5 Application Architecture and Design
- Vivek Thakur
- 431字
- 2021-05-28 17:47:11
Classic ASP Style: Inline Coding
Firstly, we will study the classic inline style of coding, which was the only option available during the good old ASP 3.0 days. This was a mix of interpreted ASP scripts and HTML code. In terms of architecture, there was not much flexibility, although developers used classes to bring some object oriented flavor to the projects, but these were not pure OO classes. Core features such as inheritance were not supported. Moreover, there was lot of effort involved in coding these classes, so most developers preferred to mix coding that was much faster in terms of development time. At a high level, an ASP project configuration would usually follow the given diagram:

In this diagram, we have ASP script files in the web server directory being processed by ASP ISAPI (Internet Server Application Programming Interface) DLL in IIS and rendered in the client browser. ISAPI DLL is a part of IIS itself, and not a separate process such as the ASP.NET runtime engine.
Here is some classic ASP sample code:
<%@ language="JScript" %> <% var pubName ="Publisher", pageTitle="Publisher Page Title" Response.Write(pubName) %> <html> <head><title><% =pageTitle %></title> </head> <body> <div> <% =pubName %> </div> </body> </html>
The above ASP code is a simple example which clearly highlights the fact that the pre-ASP net coding style was a messy mixture of HTML and ASP scripts. In this particular style, we had no logical or physical separation of the web application code. It followed a single-layer style—everything was done in the UI layer (which is a part of the application tier, and is different from the presentation tier). With none of the indispensable modern day programming features such as debugging support and IntelliSense, maintenance of such code was nearly a nightmare.
Note
Programming languages are either compiled or interpreted. ASP code was interpreted line by line, unlike modern higher-level compiled languages such as C++ and C#. Because interpreted code needs to be converted line by line into machine code at runtime, it is usually slower than compiled code, where the entire program is converted into machine instructions in one batch, typically long before any of it is run.
Then came ASP.NET, doing away with the interpreted ASP scripts and introducing a much faster compilation model along with strongly-typed languages such as C# and VB.NET, in addition to numerous other benefits, making it a strong leap from ASP.
Although not recommended, ASP.NET still allows the use of the inline coding model using <script> block constructs for C# and VB.NET code. We don't need to go deeper into inline coding, but here is a simple example of how an ASP 3.0 developer might have intuitively coded a simple project in ASP.NET without using any code-behind.
- ANSYS 14熱力學·電磁學·耦合場分析自學手冊
- 中文版CorelDRAW X7基礎培訓教程(移動學習版)
- Midjourney從入門到實戰應用
- Oracle VM Manager 2.1.2
- CorelDRAW服裝設計實用教程(第四版)
- UG NX 12.0實例寶典
- Jetpack Compose:Android全新UI編程
- 邊做邊學:平面廣告設計與制作(Photoshop 2020+Illustrator 2020·第3版·微課版)
- Premiere Pro CC 2015中文版基礎與實例教程(第4版)
- 中文版SolidWorks 2018完全實戰技術手冊
- Photoshop CS6淘寶美工完全實例教程(培訓教材版)
- Instant BlueStacks
- 攝影師的后期課:Lightroom后期技法篇
- Photoshop CS6淘寶美工完全實例教程(全視頻彩色版)
- Linux Shell腳本攻略(第3版)