ASP.NET 2.0 offers you several ways to set a dependency between a cached item and a file(s), another cached item(s) or SQL Server database table. No doubt they satisfy most of the real world needs. However, at times the features offered by these dependencies are not sufficient. In such cases you can create your own dependency and use it instead of inbuilt ones.
Microsoft Dot Net
Friday, 27 May 2011
Coding style
The program should be easy to read and to understand when you need to refer back to
it. Follow these guidelines while coding:
§ Always use "Option Explicit" to catch any undeclared or misspelled
variables. Also, the use of "Option Explicit" makes the Web pages run
fast. The "Option Explicit" option forces the explicit declaration of
variables.
§ Declare one variable per line. This avoids confusion about datatypes.
§ Use comments wherever possible to document a difficult code section.
§ Use blank lines in the code for clarity.
§ Use proper code block indenting.
Programmability
The ADO.NET model uses typed programming to manipulate objects. In typed
programming, the programming environment or programming language itself recognizes
the types of things that are important to users. To take full advantage of typed
programming, you must know the things that are of interest to programmers and to end
users. Consider the following code using typed programming in ADO.NET:
If TotalQty > DataSet1.ProductInfo("Baby Food").QtyAvailable
This code is equivalent to a line using non-typed programming and is easier to read by
end users. An end user who has little or no programming experience can easily grasp
the meaning of the condition being tested. Also, in non-typed programming, if the
developer makes a spelling mistake by chance (for example, ProductInfo is spelled as
ProdcutInfo), a run-time error will get generated. On the other hand, in typed datasets,
errors in the syntax caused by misspellings are detected at compile time rather than at
run time.
Maintainability
After an application is deployed, there might be a need for changes in the application.
For example, the application might need substantial architectural changes to improve its
performance. As the performance load on a deployed application server grows, system
resources can become inadequate, resulting in higher response times. As a solution to
these problems, the application might need to undergo architectural changes by adding
tiers. Here, the problem is not the multitier application design, but rather the problem lies
in increasing the number of tiers after an application is deployed. This transformation
becomes easier if the original application is implemented in ADO.NET using datasets. In
ADO.NET, the communication between tiers is relatively easy, because the tiers can
transmit data through XML-formatted datasets.
Interoperability
The ADO.NET model is designed to take maximum advantage of the flexibility provided
by the large industry acceptance of XML. ADO.NET uses XML for transmitting datasets
among components and across tiers. Any component that is capable of reading the XML
format can process the data. It is not necessary for the receiving component to be an
ADO.NET component. The component that is sending or transmitting the dataset can
simply transmit the dataset to its destination without bothering with how the receiving
component is implemented. The component asking for the dataset, the destination
component, can be implemented as a Visual Studio application or any other application.
However, the important point to be considered is that the receiving component should be
capable of accepting the XML file formatted as a dataset.
Scalability
The Web-based, data-centric applications require multiple users to access data
simultaneously. This increases the demand on data to be accessed, making scalability
one of the most critical features. Applications that use resources, such as database
connections and database locks, cannot support more users to access data
simultaneously, because eventually the user demand for the limited resources will
exceed their supply. Because ADO.NET uses disconnected data access, applications do
not retain database locks or active database connections for long durations. Hence,
ADO.NET accommodates scalability by encouraging programmers to conserve limited
resources, and allows more users to access data simultaneously.
ADO.NET Object Model
The .NET Framework is designed to change dramatically the developer's current style of
developing applications, including the data access features. For the .NET applications,
the primary data access technology to be used would be ADO.NET — the latest addition
to the ADO model.
The ADO.NET Object Model is primarily divided into two levels:
§ Connected Layer: Consists of the classes that comprise the Managed
Providers
§ Disconnected Layer: Is rooted in the DataSet
This section describes both the Managed Providers and the DataSet.
Subscribe to:
Posts (Atom)