Tuesday, September 16, 2008

Contents of the ASP.NET Reference Architecture (or Framework)

We have completed building the ASP.NET Reference Architecture or Framework and here are the details of what version 1.0 contains.

The figure below depicts the various components of the framework.





Framework Architecture
The framework has been styled as an n-layer design.

1. The Presentation Layer – This layer uses base classes for the page, control and master page. The base classes implement features such as localization and themes. The presentation layer also includes:
• Anti-cross site scripting libraries
• URL rewriting (“pretty URLs”) libraries
• Dirty word filtering libraries
• Navigation libraries
• Custom error handling pages
• Javascript libraries
• The framework’s user interface pages (including pages for the tools available in the framework, administration etc)
• CAPTCHA for preventing bots
• Custom user controls
• Service references to call into the service layer
2. The Business Layer and Business Layer Host – The business layer, modeled completely as a service layer uses WCF/.Net 3.0. The Business Layer Host hosts all the services in the business layer in IIS as web services. The framework allows changing the service host and service type via WCF. The business layer provides the following:
• A Business Rules Engine (BRE) that allows authorized business users to add/modify/delete business rules in the system using a friendly user interface (the BRE editor). The BRE allows for writing complex business logic outside of code using the BRE editor. Thus, when business rules change business users with little or no assistance from developers could modify them in the system.
• Base Classes for creating lists, entity objects etc.
• Authentication/Authorization Classes available in the framework make setting up the application’s security simpler.

3. The Data Access Layer (DAL) - This layer isolates database access and any data related activity such as reading, writing, deleting from the web application and business layer. This layer provides classes to create database connections, access stored procedures, run queries etc. The DAL currently supports MS SQL Server data access, but can be extended to support Oracle, MySql etc

Tools
The framework provides various tools useful to different stakeholders of the application including administrators, project managers, developers, QA engineers addressing some common supportability requirements of most applications. Tools included in the framework include:

• SQL Data Population utility – This web-based utility allows the project team to insert large amounts of meaningful data into the application’s database(s). Doing this on day one will ensure that the project team detects any load related performance problems early in the project. This is also useful to QA teams who can use this utility to generate test data.

• Performance Monitors – Two tools monitor performance in the framework. The first tool displays various useful statistics of the web server including CPU usage, memory usage, no. of requests, queued requests etc. This tool is useful in production environments to administrators and developers, who do not have access to the server directly, yet are able to monitor the server’s behavior. The second tool displays useful statistics about the application such as average no. of calls made to a method per second, total no. of calls made to a method, total no. of exceptions, no. of exceptions per second, the duration of calls made to a method etc. This tool is useful in production environments to developers in diagnosing problem areas in the application.

• Application Dependency Checker – This web-based tool displays the health of all the various dependencies of the application such as web services, FTP servers, DB servers, HTTP servers. It shows whether the dependent service/server is up or not. It also displays the version numbers of assemblies (DLLs) used by the application. This utility is useful to developers and administrators to debug problems in the application quickly.

• Exception Report – This report displays the exceptions generated by the application in a given time period. This tool is useful to administrators and developers in analyzing errors that are occurring in the application.

• Health Monitor – The health monitor tool displays useful information about the application for a particular day such as heartbeat events (including when the application was stopped/started), application request events (the requests the application received), audit events (when authorization/authentication succeeded/failed) and management events.

• Site Usage Report – This tool is useful to business users and developers in understanding the usage of the web application. This report provides information such as No. of requests received in an hour, No. of bytes sent in a hour, Most frequently used pages/sections, clients that have been using the application, The types of browsers that are using the application and HTTP errors that were generated by the application.

• Secure Config – This tool can be used to encrypt certain sections of the web.config file by administrators in order to prevent anyone with access to the file from gathering critical information such as userids/passwords, server names etc.

• User/Group/Permissions Admin Tool – This tool allows authorized personnel to add new users to the application, add users to certain groups, and assign permissions to the user or group.

• Database Tools – There are two tools in the framework to monitor the database(s) used by the application. A Database Growth Report shows the percentage growth in the application’s database and specific tables that are growing at a rapid rate. This report is useful at predicting and preventing future performance problems. The Database Details Report shows various details about a database such as no. of SPs in the database, no. of tables, the tables in the database and their size and other useful information. This report is useful to developers who do not have access to production database environments and need this information to diagnose problems.

• Business Rules Editor – The Business Rules Editor is the user interface to the Business Rules Engine. The Editor is useful to business users who wish to change business rules and logic applied in the application.


Developer Utilities
The framework contains numerous classes useful for carrying out various common tasks during development of the application. These include:

• Caching - The caching classes provide developers with the ability to cache frequently used data objects and refresh the cache. This reduces redundant calls to the database, improving the performance of the application.
• Exception Handling - The exception handling classes provide developers with a standardized way in which to manage exceptions.
• Logging – The logging classes provide developers with a standardized way in which to log various types of messages in the application.
• Security (Encryption, Password) - The Security classes provide developers with various encryption algorithms, password hash creation methods and random password generators.
• Health Monitoring - The heath monitoring classes provide methods to create various performance counters related to the system (such as CPU usage) and the application (such as no. of calls made to a method).
• Xml Data Utility - The XML data utility class provides easy to use methods for reading and manipulating XML data.
• Others - FTP classes, Date Time formatters, Enum creators, various formatter classes, Config readers, Reflection classes, a generic HTML class, Zip libraries etc. are also included as utility classes.

Visual Studio Enhancements

The framework provides its own
• Templates - Custom versions of frequently used templates in Visual Studio such as the user control, ASPX page, Master Page and the project template. These custom templates provide several benefits to developers including standardization in the way code is written and lesser repetitive work for developers.
• Code Snippets – Code snippets are provided for frequently written code fragments, to hasten the development process
• Setup/Install Package – The framework includes a project that allows for creation of an installer and changing certain configuration settings of the framework depending on the environment (QA, production etc.) installed in. This makes for a smoother deployment of applications built with the framework.

Framework Building Blocks
The framework uses the following key components (among others):
• .NET 2.0 framework – This provides the execution runtime for the framework and class libraries for various functions based on which the framework is built
• ASP.NET 2.0 – This provides the core infrastructure and libraries for running the website along with IIS.
• ASP.NET Role & Membership providers – The Authentication, Authorization, and Role Based Access Control components in the framework use these providers.
• ASP.NET AJAX – The framework uses ASP.NET AJAX to provide a rich user experience, where appropriate.
• ASP.Net Health Monitoring – This provides the core infrastructure for the health-monitoring component in the framework.
• Microsoft Enterprise Library – The framework uses the Logging, Exception, Data Access and Policy Injection blocks to build various components of the framework.
• ADO.NET – The data access layer of the framework uses ADO.NET.
• WCF and .NET 3.0 – The framework’s service layer use these two components.
• Silverlight and Visifire – The Business Rules Engine’s user interface uses Silverlight, whereas some of the reports in the framework use Visifire.
• Microsoft Anti-XSS library – The framework includes the Microsoft Anti-XSS library that provides methods to prevent Cross-Site Scripting attacks.
• SharpZipLib – The framework includes the GPL licensed SharpZipLib to provide methods for compression and decompression.
• Visual Studio 2005/2008 – The framework uses Visual Studio 2005 and 2008 editions as the IDE tools.


Version 2.0 of the framework will look at inclusion of Workflow Foundation, ADO.NET Entity Framework, ASP.NET MVC and others as appropriate.

No comments:

Post a Comment