Tag Archives: asp.Net

What are Portable Class library in c# ?

The whole point of creating a class library project is reusability. Now we want this reusability not only within a .NET application, not across .NET applications but across different types of .NET applications. Now different types of .NET application means WPF, Windows, Silver light, Windows phone etc. That’s where portable class libraries are useful. By creating a portable class we can reference it in any kind of .NET project types.

.Net Architecture OVERVIEW

.Net Architecture consists of the guiding principles behind a given application. It is not strongly tied to a particular framework or library.

Design: When you talk about what to do when a user logs in ?

Ex. Usability, portability, accessibility etc.

Architecture: When you talk about what to do when 5000 users logs in simultaneously ?

Ex. Scalability, reliability, availability, performance etc.

Architecture is about style, abstract idea, flow, methodology, concept. Framework is something which implements the style, idea, concept etc..or makes it easier to implement it. example,

Architecture: Every component should have standard pluggable interfaces and it should be possible to connect any component to any other.

Framework: Then lego building blocks can be the framework.

Library: some readymade combinations of blocks that would work as the pillars.

Application: A building structure using the pillars and other building blocks(application).

Framework is a part of architecture implementation. Say, our app will be organized according to .Net architecture and will use .Net framework for that. Different frameworks are organized according to different architectural patterns. Someone can say, that term “framework” is itself describes architectural pattern. Its “opposite” is “library”, because libraries are directly controlled by your application while frameworks use inversion of control and they control execution of your code. Though, there are controversies in using term “framework”.

I think framework is something that is created by someone and available to you to accomplish a objective. Like .Net  is a framework to write GUI and console application. Frameworks takes full control from you but gives you the advantage of not trying to do everything from ground up. In most cases it is better to use a well designed and tested framework, rather than write your own.

In this context architecture is how the framework has been designed and possibly the way to use the framework from you application maintaining the vision of the framework designers.

But broadly architecture is the design principle and can encompass not only software but complete systems as well. Think security, integration, reporting, infrastructure aspects etc.

Framework:

Architecture:

The .NET Framework represents a unified, object-oriented set of services and libraries that embrace the changing role of new network-centric and network-aware software. In fact, the .NET Framework is the first platform designed from the ground up with the Internet in mind.

Benefits of the .NET Framework

The .NET Framework offers a number of benefits to developers:

§ A consistent programming model

§ Direct support for security

§ Simplified development efforts

§ Easy application deployment and maintenance

ASP.NET and the .NET Framework

ASP.NET is part of Microsoft’s overall .NET framework, which contains a vast set of programming classes designed to satisfy any conceivable programming need. In the following two sections, user can learn how ASP.NET fits within the .NET framework, and user learn about the languages user can use in userr ASP.NET pages.

1.      The .NET Framework Class Library

2.      .NET Framework-Compatible Languages

The .NET Framework Class Library

Maintaining all the functionality for multiple languages in a single wallet requires a lot of work. Why keep reinventing the wheel all the time? Means it’s very hard to remember the syntax, variable type, data type, declaration & function. Wouldn’t it be easier to create all this functionality once and use it for every language?

A Library is a reusable set of types/functions you can use from a wide variety of applications. The application code initiates communication with the library and invokes it.

The .NET Framework Class Library does exactly that. It consists of a vast set of classes designed to satisfy any conceivable programming need. For example, the .NET framework contains classes for handling database access, working with the file system, manipulating text, and generating graphics. In addition, it contains more specialized classes for performing tasks such as working with regular expressions and handling network protocols.

The .NET framework, furthermore, contains classes that represent all the basic variable data types such as strings, integers, bytes, characters, and arrays.

Most importantly, the .NET Framework Class Library contains classes for building ASP.NET pages. User need to understand, however, that user can access any of the .NET framework classes when user are building userr ASP.NET pages.

Understanding Namespaces

The .NET framework is very huge. It contains thousands of classes (over 3,400). Fortunately, the classes are not simply jumbled together. The classes of the .NET framework are organized into a hierarchy of namespaces.

A namespace is a logical grouping of classes.

For example, all the classes that relate to working with the file system are gathered together into the System.IO namespace.

The namespaces are organized into a hierarchy (a logical tree). At the root of the tree is the System namespace. This namespace contains all the classes for the base data types, such as strings and arrays. It also contains classes for working with random numbers and dates and times.

User can uniquely identify any class in the .NET framework by using the full namespace of the class. For example, to uniquely refer to the class that represents a file system file (the File class), user would use the following:

System.IO.File

System.IO refers to the namespace, and File refers to the particular class.

Standard ASP.NET Namespaces

The classes contained in a select number of namespaces are available in the ASP.NET pages by default. (User must explicitly import other namespaces.) These default namespaces contain classes that user use most often in the ASP.NET applications:

·         System— Contains all the base data types and other useful classes such as those related to generating random numbers and working with dates and times.

·         System.Collections— Contains classes for working with standard collection types such as hash tables, and array lists.

·         System.Collections.Specialized— Contains classes that represent specialized collections such as linked lists and string collections.

·         System.Configuration— Contains classes for working with configuration files (Web.config files).

·         System.Text— Contains classes for encoding, decoding, and manipulating the contents of strings.

·         System.Text.RegularExpressions— Contains classes for performing regular expression match and replace operations.

·         System.Web— Contains the basic classes for working with the World Wide Web, including classes for representing browser requests and server responses.

·         System.Web.Caching— Contains classes used for caching the content of pages and classes for performing custom caching operations.

·         System.Web.Security— Contains classes for implementing authentication and authorization such as Forms and Passport authentication.

·         System.Web.SessionState— Contains classes for implementing session state.

·         System.Web.UI— Contains the basic classes used in building the user interface of ASP.NET pages.

·         System.Web.UI.HTMLControls— Contains the classes for the HTML controls.

·         System.Web.UI.WebControls— Contains the classes for the Web controls.

.NET Framework-Compatible Languages

Visual Basic is the default language for ASP.NET pages. This includes C# (pronounced See Sharp), JScript.NET (the .NET version of JavaScript), and the Managed Extensions to C++.

Dozens of other languages created by companies other than Microsoft have been developed to work with the .NET framework. Some examples of these other languages include Python, SmallTalk, Eiffel, and COBOL.

The first time user request an ASP.NET page, the page is compiled into a .NET class, and the resulting class file is saved beneath a special directory on the server named Temporary ASP.NET Files. For each and every ASP.NET page, a corresponding class file appears in the Temporary ASP.NET Files directory. Whenever user request the same ASP.NET page in the future, the corresponding class file is executed.

When an ASP.NET page is compiled, it is not compiled directly into machine code. Instead, it is compiled into an intermediate-level language called Microsoft Intermediate Language (MSIL). All .NET-compatible languages are compiled into this intermediate language.

An ASP.NET page isn’t compiled into native machine code until it is actually requested by a browser. At that point, the class file contained in the Temporary ASP.NET Files directory is compiled with the .NET framework Just in Time (JIT) compiler and executed.

The magical aspect of this whole process is that it happens automatically in the background. The user has to do is create a text file with the source code for ASP.NET page, and the .NET framework handles all the hard work of converting it into compiled code for user.

 

Skip to toolbar