- ASP.NET 3.5 Application Architecture and Design
- Vivek Thakur
- 390字
- 2021-05-28 17:47:12
Limitations of Coding in the UI Layer
Even though we have only one layer, the separation between HTML and UI code, using code-behind files, helps the web designers to work independently of the developers. Both have separate files to work on. This is a recommended practice, as mixing UI markup with logical UI processing code can lead to a spaghetti mixture. Besides this furthermore, the style is more object-oriented than inline coding as we write code in code-behind classes instead of writing it in interpreted free-style blocks as in classic ASP. So code-behind helps us manage and maintain our code in the long run, when compared to inline coding.
However, note that even though we have separated the code into two layers, both of these layers actually belong to the UI layer. Even if we are putting data access or business logic code in the code-behind files, we are still mixing the UI layer with non-UI code, which is not recommended for commercial scalable applications. In the coming chapters you will learn how to further use layers and tiers to make your application more scalable.
But if your project is small, for example, a 4 5 page website for personal use or a small data entry website which is not intended to grow in size, complexity, or user base, and where there is no future need to scale it up, then putting the data access code in the code-behind files is acceptable. Remember—"if it ain't broke, then don't fix it". There is no need to complicate a simple web application if there is no actual requirement to justify doing so. Designing scalable solutions from the start is a good approach, but that does not mean we need to start over-architecting every website we work on without thinking twice about its real use and application. Furthermore, budget constraints sometimes might not allow us to adopt a fully-fledged N-tier scalable solution because the project is either too small or there is no scope for it to grow further, and therefore the project stakeholders might not want to spend too much on its development because building a scalable architecture takes time and will not make economic sense for a small project.
Next, we will learn about Data Source Controls, and how we can put them to best use for small projects.
- Alfresco Developer Guide
- Word論文排版之道
- UG NX 8.0基礎與實例教程
- Cacti 0.8 Beginner's Guide
- AutoCAD 2014電氣設計從入門到精通
- Liferay User Interface Development
- 中文版Illustrator CC 2018基礎培訓教程
- 中文版Photoshop CS6全能一本通·全彩版
- PS App UI設計從零開始學
- 中文版Photoshop CS6經典自學教程
- 機械CAD軟件應用入門指導書
- 剪映專業版:短視頻創作案例教程(全彩慕課版)
- 中文版Photoshop CS5基礎培訓教程(移動學習版)
- Web Host Manager Administration Guide
- Plone 3 Theming