hi!
Are you a .NET programmer?
If so, try to share your .NET programming skills.
Thank you
-Viswanath
Do you know...

Visual Studio.NET is richest among all the other developer IDEs

.NET Chunks

Showing posts with label .NET platform. Show all posts
Showing posts with label .NET platform. Show all posts
        In general sense, an IDE (Integrated Development Environment) is a software development or a designer tool that
-increases the accuracy of developing the software apps
-reduces the time taken to develop a software app which ultimately leads to the faster app development.

        To develop a .NET app quickly and accurately Microsoft developed two IDEs:

1. Visual Studio.NET (VS.NET): This is mainly a developer IDE which enables
    -a developer to write code for windows or web…..apps in user friendly manner and
    -a designer to design a desktop or web app in user friendly manner but the design might not be so rich.
     Major basic Features: (exist from .NET 2.0)
    -It (VS.NET) understands the .NET framework (CLR+BCLs). I think you agree with me if you had already used .NET intellisense (drop downs). It is going to notify you which property or which method you need to use for a specific class and which class belong to which namespace and so on…
    -It understands the language compilers. This you would agree if you had already compiled a simple C# program without placing a semi-colon at the end of the statement….
    -It gives you inbuilt database support. This you would agree if you had created and managed a simple table from the server explorer window of VS.NET studio.

    There are lot of other features .But I think VS.NET is self-explanatory. Go – observe – design and code.

2. Expression Studio: This is exclusively a designer IDE which enables a designer to design very very…rich desktop and web apps. This also with same notion Go-Observe-Design.

Warning: But as a learner I just want to suggest you not to involve too much in VS.NET because it is going to kill your programming skills…this is for sure. If you are a real time developer...its fine….because you need to save time… Though you (learner or a developer) use it …just try to observe what is happening…..
With support of .NET platform, one can build quiet a number of applications that might be useful in our day-to-day life. The following is a list of some applications that can be build using .NET platform:


-Windows applications: Mostly used for desktop development. It involves development of Win Forms. E.g.: Any Software that we install within our desktop systems.

-Console Applications: Mostly used for creation of character user interface applications.
E.g.: DOS based applications

-Web Applications: Used for Web Development. These applications use ASP.NET technology for their development.
E.g.: Any webpage with extension .aspx.

-Windows and Web code libraries: Used for windows and web development. These include a set of user defined classes under a given user defined namespace. These are consumed by the programmers while developing windows and web apps. These are like user defined BCLs.
E.g.: A user defined class for defining the validations performed during a registration.
Note: Always first check in the.NET documentation for the required class before developing it. For example if you want to define a class that perform the validations for registration-first check whether any such class exists in the predefined .NET library and if present just consume it instead of creating it.

-Windows Services: These are set of services that run at the backend of windows OS. To get a clear idea I think it would be better if you check them manually as follows: Control panel -> Administrative tools -> Services (Windows Services). E.g.: Windows Audio service…

-XML Web Services: These help in the development of xml based distributed web applications. E.g.: WWW or P2P networks based applications.

-Smart Device Applications: These include applications that we build for Smart phones, pocket PCs etc.

And so on……..
        We already know that .NET Framework=CLR+BCLs (mainly). Like CLR, BCLs also play a very important role in the .NET app development. BCLs are predefined libraries developed by the Microsoft team that provide a set of functionalities (E.g. Interaction with databases, Interaction with Web etc.) to develop a .NET app. As the number of functionalities is at peak, the classes or interfaces associated with these functionalities are also at peak. So it is difficult for a user to consume them. For this purpose “Namespaces” were defined.

        A Namespace is nothing but a group of classes or interfaces that have similar functionalities. These namespaces are created in a hierarchical format. We can define even our own namespaces.
E.g.1. All classes or interfaces related to Web are grouped under “System.Web” namespace.
E.g.2. All classes or interfaces related to Database are grouped under “System.Data” namespace.
E.g.3. All classes that we create manually like first1, first2 etc. can be kept under a namespace like MyNameSpace (which is user defined namespace).

        This grouping of classes or interfaces under a namespace has following advantages:
-There is a possibility of having classes or interfaces with same name under different namespaces.
E.g. System.Console (predefined console class placed under predefined namespace) and MyNameSpace.Console (user defined console class placed under a user defined namespace).
-This grouping will help the developer to consume the classes in a user friendly manner as he will be able to find them in a hierarchy.

        The following diagram shows some basic functional groups of BCLs and then some namespaces associated with each functional group:






        The above mentioned namespaces are just a sample. There are still a number of other namespaces under BCLs that provide different other functionalities.
        In general sense, a language is a mixture of syntax and associated semantics that allows a programmer to develop required applications based on the logic. A language also consumes some predefined set of libraries that define some set of functionalities using which an application can be developed.


        As we already know that a .NET framework also includes some set of predefined libraries (BCLs) which can be utilized to develop a .NET app. These BCLs can be consumed by any language that subscribes to Common Language Specifications (CLS).

        Some of the languages that subscribe to CLS are:

-C# (includes features of C++ and Java)
-C++/CLI (CLS compliant implementation of C++)
-VB (From 7.0, CLS Compliant implementation of traditional VB)
-J# (CLS Compliant implementation of Java)
-F# (CLS Compliant implementation of Functional programming language ML)
-A# (CLS Compliant implementation of Ada)
-L#, Iron Lisp (CLS Compliant implementations of LISP)
-P# (CLS Compliant implementation of Prolog)
-Jscript.NET (CLS Compliant implementation of Jscript)
-Iron Python (CLS Compliant implementation of Python)
-Iron Ruby (CLS Compliant implementation of Ruby) and …………….

        Among these the VB and C# are developed by Microsoft and so they are most commonly used by the .NET programmers. The .NET SDK (Visual Studio) by default provides the compilers for C#, VB, C++. To work with any of the other languages a programmer needs to install the corresponding language compilers explicitly.
CLR (Common Language Runtime) mainly has the following common responsibilities:

-CLR's JIT (Just-in-Time) compiler is responsible for execution of the IL (Intermediate Language) code at the developer end while he is developing the .NET apps as well as at the client end when the .NET app is deployed.

-CLR provides automated memory management using Garbage collection. Due to this .NET memory management is isolated from .NET app developer i.e., CLR's garbage collector (GC) takes the responsibility in allocation as well as deallocation of memory for the created objects and there is no role of .NET developer in this activity(allocation and deallocation of memory).

-CLR's Common Type System (CTS) is responsible for maintaining the cross platform support for various types (data types)  of various .NET compatible languages.

-CLR's Exception Manager is responsible for runtime error handling (Exception handling).

        These are some common responsibilities os CLR. There are even some other responsibilities for CLR that are not discussed above, but will be discussed later.
Why versions??
The goal in application development is always the same: create the best possible software in the least amount of time. Yet the bar is continually raised, as demands from customers increase. To meet these demands, the platforms developers build on and the tools they use must get better and better—they must evolve.    -David Chappel, Chappel & Associates.

        I reckon, this software upgradation or enhancement or evolvement, whatever it is, can be called as versioning. The best example we can consider is .NET framework itself. Since its birth in 2002, .NET framework evolved version by version as follows:



The .NET framework architecture is mainly depicted as follows:




The architecture shows the following:

-.NET framework (CLR +BCLs)

-Operating System, in which the .NET framework and Visual Studio development tool can be installed . The OS can be either Windows or any other such as LINUX , UNIX, Solaris etc. for installing .NET framework since it is platform independent. But to install and use Visual Studio we need only Windows platform since Visual Studio tool is platform dependent.

-Technologies that subscribe to .NET Runtime
-Winforms, ASP.NET, ADO.NET (.NET framework 2.0 additions)
-WPF (Windows Presentation Foundation), WCF(Windows Communication Foundation), WF 
(Windows Workflow), CardSpace .(.NET framework 3.0 additions)
-LINQ (Language Integrated Query), ADO.NET Entity framework (.NET framework 3.5 additions).
   
-Languages that subscribe to .NET Runtime (C#, J#, VB etc.) i.e. those languages that are according to CLS (Common Language Specifications)
        One of the most fascinating features of .NET platform is its language independence. The major reasons behind its language independence are:

-Common Language Specifications (CLS): Every language that is targeting the CLR (i.e. .NET compatible languages such as C#, VB, J#, etc.) should generate the same type of CIL (Intermediate Language) code. Due to this specification the CIL code that is generated after compiling the C# source code can be consumed by VB and vice versa and this is applicable even for all the other .NET compatible languages.

-Common Type System (CTS): Every .NET compatible language defines its types based upon its individual standards. For example C# defines integer type as "int" whereas VB defines it as "integer". But for .NET Runtime int is an int, whether it may be C# type or VB type. This enables C# code to be consumed by VB and vice versa.

-Consumption of BCLs: All the BCLs are written in C#. But they are consumed by every .NET Compatible languages.

       All the above three features prove that .NET is really a definition for language independence.
       
       As soon as the developer completes developing the .NET app, he does the following:
- Compiles the app's source code with the help of corresponding language compiler to generate intermediate language code (IL code) [actually speaking when a .NET app's source code is compiled, an assembly (with .exe or .dll extension) is generated and IL code is part of that assembly. I will post about assembly in detail later].

-The assembly (which contains IL code) that is generated is carried to the client machine. As it is platform independent (cross platform support) it can be executed on the client machine. But prerequisites such as .NET framework (of required version) should be installed on the client machine prior to the execution of the assembly. At the client end the JIT (Just-in-time) compiler is responsible for the execution of the .NET app assembly. This JIT compiler is part of CLR, which is in turn a part of .NET framework

         This completes the journey of a NET app..In short it can be shown as follows:


        To develop a .NET app a developer first of all needs to install .NET runtime (CLR) on his machine along with BCLs. These two (CLR+BCLs) together may form a framework i.e. .NET framework. For developers feasibility Microsoft designed a developer environment or a tool i.e. Microsoft Visual Studio that includes inbuilt .NET framework. Just the developer needs to install this tool on his machine and start developing his apps. But once the developer starts using Visual studio, i. he needs to choose a language (C#, VB, J#, Pascal or any other 16 officially supported languages) that utilize the BCLs ii. he needs to choose the type of application (console, Windows, Web etc.) he needs to develop and start working out..

      Now the client (who utilizes the app developed by the developer), needs to install the .NET framework (required version) within his machine first to run the respective .NET App and then he can start consuming the app.
      In 1980's and 1990's DOS OS was prominent. By the end of 1990's Microsoft developed Visual Basic Language which is the basic language for developing windows apps. So, the problem at that time was "Most of the computer users are dependent on MS DOS, but they want to use and develop windows apps in parallel". Keeping this in mind Microsoft allowed the DOS users to run the windows apps on DOS OS. But to allow this Dual platform ( only DOS and Windows) support Microsoft developed Windows Runtime (Core for Windows OS to run of any version) . When the DOS user installs windows runtime, then he can work with windows apps in parallel. So we can say windows sit on top of DOS.

      Now at the start of this millennium (mostly 2001) Microsoft developed the .NET Runtime which has similar functionality to that of Windows runtime but this is Cross platform (Windows or any other OS)supporter and allows programmers portability (a C++ programmer can easily develop a .NET App). So we can say that .NET runtime sits on top of Windows (or any other OS).

    Note: To work with Windows apps Microsoft designed VisualStudio.NET which is needed to be installed on DOS OS to run windows apps and now in Windows OS to run Windows, Web etc. apps.

    So, the credit for initiating the concepts of cross platform support and developing windows goes only to Microsoft. Microsoft Hip Hip Hurray!!!
        I reckon .NET platform is a combination of two major aspects i.e., CLR (Common Language Runtime) and BCLs (Base Class Libraries) which are interdependent on each other. CLR is responsible for performing all the system wide operations such as executing a .NET app , garbage collection and providing security to the code. BCLs are the predefined libraries written in C# language.

        CLR is responsible for executing a .NET App on the client machine using the BCLs. This is where the interdependency between CLR and BCL's comes into picture.

        For instance, imagine that your body is a .NET platform, your brain is CLR, your physical parts like hands are BCLs and whatever the action you perform is an application. Now in your body (.NET platform) your brain (CLR) uses your hands (BCLs) to perform (execute) an action (application) like eating etc., Similar is the functionality in a .NET platform.

   

End .NET Chunks