.NET framework is build by microsoft for developer to develope complex enterprise application with more ease.
In this section we will see the building blocks of .net framework , which will give a brief idea of different types of applications that can be created and the execution cycle of an application that can be created in any .net compatible language,what i mean to say is ,with .net framework we can build different application like web based, windows based, data centric, very rich GUI using windows presentation foundation(wpf),web services and so on can be created and the best part is,these application can be executed on any platform,which is the need in todays world.
-: COMPONENTS OF .NET FRAMEWORK :-
Now, it's time to see the components of framework so, let's have a look at the figure1.1.
.net framework consist of different components and each components has different role to perform.
-: COMMON LANGUAGE RUNTIME(CLR) :-
As I explained to you earlier that, different types of applications can be created using .net framework and to execute these application on any device CLR plays very important role as CLR is one which executed the application .
It is also known as execution engine or heart of .net framework.
-:FRAMEWORK CLASS LIBRARY (FCL):-
FCL consists of classes that all application can use to develop user interface, web pages or access database. It also contain core classes which provide basic functionality like collections,security,xml support etc.
-:COMMON LANGUAGE SPECIFICATION(CLS):-
language to become .net compatible language, every language has to follow certain rules and that rules are defined in common language specification.
-:COMMON TYPE SYSTEM(CTS):-
A code written in one language can be used in a code written in another language.
This becomes possible because of CTS . It also define common datatypes so that the code become interoperable.
-: MICROSOFT VISUAL STUDIO .NET :-
Any .net application can be created by using visual studio .net INTEGRATED DEVELOPER ENVIRONMENT (IDE) Tool.
It also provides in-built application templates and tools for building .net application.
Now I would like to tell you all that , what are the key features of languages which are supported by .net
the key features are:
1. It's standardization by ECMA(EUROPEAN COMPUTERS MANUFACTURERS ASSOCIATION) CLS has been accredited by ECMA which is the official international standard. This helps third parties to build their .net distributions on other operating systems.
2. Object-Oriented:
As all the .net compatible languages are objet oriented hence,provide pure object oriented solutions to real world problems.
.
3.Component based:
reusable piece of code is known as component. It can be created by using any.net language and can be used by any.net application.
Now we will see the concept of interoperability......
Each language is unique in terms of strength and compatibilities . Some offers good support for advanced mathematics processing , some for logical calculation , financial calculation, etc.. The strength of any language combined with .net framework create a win win situation.
Any object in c# can interact with other object in vb.net or j# . Even the type in one language can extend the functionalities of type present in another language. This approach facilitates language interoperability.
Common language specification (CLS) defines rules for the language compiler.
It is a subsetof the common type system (CTS). The CTS defines the rules concerning datatypes. They together ensure language interoperability and faster application development.
Now next part is the execution of .net application........see figure 1.2
A code written in a perticular .net language is first compiled by language specific compiler and then, MSIL(microsoft intermidiate language) code is generated , MSIL code is platform neutral, which means , this code can be executed on any platform.
To do this CLR is required..
CLR convert the MSIL code into platform dependent code.
But, the point to note here is, .net source code is compiledtwice before execution -first by language specific compiler and then by just-in-time compiler, which is a component of CLR.
....there are few terminology associated with the execution...
-: MANAGED CODE :-
By default , every code written using any of the .net languages like c# or vb.net is a managed code as this code is managed by CLR.
.Net applications when compiled convert this code into a language neutral non executable code called MSIL.
-: MANAGED DATA :-
Every data required by any .net application while execution is allocated and de-allocated by CLR. This data is referred to as managed data and the heap where these objects are created or reside is termed as managed heap.
One of the core service provided by CLR is garbage collection.
By providing this service, CLR automatically takes care of cleaning up the memory while freeing the resources.
Assembly Loader
assembly loader is one of the components of CLR . It first locate the assembly which contains main() and then loads it into memory .
It also locates and loads other class from FCL which are referenced in the code.
CODE VERIFIER
It is the core component of CLR.
It verifies MSIL code to check permission against trust policies definec in .net environment.
This concept is called code access security , with the help of code verifier and security configuration .net environment can prevent execution of unsafe code.
In short it verifies wheather the code is secure code to execute.
JUST-IN-TIME COMPILER (JIT)
when a method is invoked , the JIT compiler analyzes the MSIL code and produces highly efficient machine code . It also checks the information weather the code is compiled or not and if the code is not compiled then its compiles only the code that is not yet converted to native code.
There are three types of JIT compilers:-
1. STANDARD JIT :- it is used in development of application as mentioned above.
2. Pre JIT - it compiled MSIL during installation and setup time.
3. Econo JIT - it is used for mobile applications.
ASSEMBLIES
Assembly is a logical unit of deployment..
The main components of assembly are:-
1. Manifest -it contains the assembly information such as, version,security,identity and references to other assemblies and also contains a list of files present in the assembly.
2. Type metadata-metadata provides information about all types defined in the assembly such as classes , interfaces, properties, methods, delegates , events etc..
3. MSIL code-this is the microsoft intermediate lanaguage code . Before the code is executed , JIT compiler of CLR converts it to CPU specific native code.
4. Resources - resources like image resources i.e .bmp and .jpg .
Files and general allocation is one resources file per application.
"THIS BLOG IS FOR A STUDENTS OR A BEGINNER WHO WANTS TO LEARN C AND WANT TO EXPLORE THE WORLD OF C PROGRAMMING."
MyblogAd
Sunday, March 16, 2014
Thursday, March 13, 2014
Object oriented concepts overview
previously, we have discussed about why we should learn .net technology. In this section we will discuss about what is overview of object oriented programming.
An object oriented programming is a language which satisfy the condition of :
1.Abstraction
2.Encapsulation
3.Inheritance
4.Polymorphism
All these are the key concept of any object oriented programming language.
Let's see what exactly all these terms are?
1.Abstraction:
Abstraction is nothing but , it is a process to identify the key aspects of an entity and ignoring the rest.
In simple term, I will say then it is a process which only take the important aspect which is required for current senario.
For example,let's take a senario where a person visit to your house for social survey ,few qurstion he ask's while doing his survey i.e
1.name of all the person living in the house?
2.Occupation
3.Martial status
4.Qualification
5.age
6.religion
7.income etc.
Where as if we go to the hospital,the information which they ask or note is:
1.Name of a person
2.Age
3.Blood group
4.weight
5.previous medical report
so,we can see the difference for bothe senario where one requires different information than other or one requires more information than other.
So, here this information which is gathered by both this institution is nothing but the aspects which is important for both of them according to their institution , else their output will not meet with the expectation.
So,here the arise is , what is the differnce between object-based and object-oriented language?
The answer is,all languages that support abstraction , encapsulation , inheritance and polymorphism are known as object oriented language.
E.g:-
Java,c#,vb.net etc..
And on the other hand , All the languages that support abstraction and encapsulation ,but do not support inheritance and polymorphism are known as object based language.
E.g :- vb
2. Encapsulation:
Encapsulation in a simple term means 'data hiding', with the help of encapsulation one can hide data, internal structure and implementation details of an object.
Let's take an example of television , when we switch on the television what we see is visuals on the screen and we can change the channels with the help of remote control but,the functionality inside the television is hidden from end user.
In a similar way, in encapsulation an interface is provided to the end user to use it but the implementation of that interface is hidden from end user.
As we have talked about 'object' let us see what is meant by 'object'in .net.
Object:-
An object is an entity which has well defined structure and behaviour , it also possesses certain characteristic i.e,every object has state,behaviour , identity and responsibility.
For example :- a car is an object,an employee is an object.
An object can be tangible , intangible or concenptual.
Some more examples are air,sound,bank account etc.
What is meant by state of an object?
The state of an object includes the current values of all its attributes .
To give you guys a clear picture let's take an example of a window on a computer so, here your window acts as an object and the height , width, the background color and it's x-y co-ordinates is nothing but the attributes of window and the current values in those attributes will describe the state of that window say for example:
minimized will have different value,maximized will have different value,restore will have different value.
Behaviour of an object:-
Behaviour of an object is nothing but how an object reacts with the change in value.
For example:-
when we switch 'on' fan , we pass a value through which fan starts rotating and when we switch 'off' fan ,it slowly stops running,it means fan change its behaviour when button is switched on or off.
Identity of an object:-
As the name suggest , identity is nothing but something unique in an object through which an object can be recognized very easily.
For example:
An employee working in an organization can be easily identify by his employee id.
So,employee id acts as an identity of an employee in that organization.
Responsibility of an object:-
The responsibility of an object is the role it serves within the system.
For example:
the responsibility of an employee is to carry out the work given and get the salary.
Done with the talking of object , let's continue with our third concept of object oriented programming..
3.Inheritance :
Inheritance is the process by which one object can acquire the properties of another object.Inheritance has a 'is-a' kind of hirarchy.
For example:
vehicle can be categorize in two wheeler , three wheeler,four wheeler and again two wheeler can be categorize in geared and no geared , so now let'a create a hirarchy geared and non geared 'is-a' two wheere and two wheeler 'is-a' vehicle.
Note:
multiple inheritance is not applicable in .net. Only multilevel inheritance is applicable.
4. Polymorphism:
'poly' means many and 'morph' means forms in short polymorphism means many forms. Technically if i will say then , polymorphism is nothing but the ability of different types of related objects to respond to the same message in their own ways is called polymorphism.
Wednesday, March 12, 2014
Introduction to .net
Before starting with c# , let me tell you what was there in my mind when I heard from my friends that they will be persuing for .net course during graduation. At the same time the first question I asked to my friends is, why .net?. And I know that same question is there in your mind as well.
So,let's see we should learn c#?.
Most of us know that prior to c#.net , there are few more programming languages for example c,c++. But still there were some problem which was face by the developer. for example, as we all know that c is structured language and it was very difficult to manage presentation logic in c and in c++ as it is an object oriented programming language , it focus more on business logic and very less in presentation logic.
Hence,microsoft has develop a technology called .net which gave developers a better options for presentation logic and business logic.
C# is easy to learn ,a person who have little bit knowledge of c++ can easily grasp c#.
Comming soon...
Comming soon with complete learning series for c,c++ and .net..............
Subscribe to:
Comments (Atom)