Wednesday, April 30, 2008

Some basics of Microsoft .NET - Part 02

Features of .Net explained…

· Object Oriented Development Environment.
· Automatic Garbage collection
· Interoperability
· No COM Required
· Simplified Deployment
· Type Safety

Object Oriented Development Environment.


Basic Components of .Net ( CLR, BCL, and Programming Languages like C# or VB) all are perfectly designed to work in a well integrated Object oriented environment. One of the keen feature of .Net framework is its consistent Object oriented programming model.

What surprised me is that, it even provide a wide range of platform target. You can write a web application or windows application which can work from high end servers to a Cell phone.
Who else will give such a broad range ?? :)

Automatic Garbage collection

If you are C++ or C programmer you will feel relief now… CLR has a tool called Garbage Collector which automatically manages memory. Well its like a memory watcher but does more.

Garbage collector deletes all objects from memory which is no longer accessed in the program. ( means less effort in memory management of your application)

As I told earlier, if you are traditional programmer, you will be hunting for all kinds of memory leaks and will be reallocating those memories. Well this is not a small feature, believe me it’s a time taking task to find out the memory leak issues… In these cases Garbage collector is a great pain reliever .. :D


Interoperability


Interoperability, I guess this will be one among the most good feature that attracted many programmers. .Net Framework is designed to work with different .Net languages , different OS and different COM components.

Recently I read a whitepaper from Microsoft, it says .Net framework will soon support programming languages like Python and Ruby. Means it will become DLR ( dynamic Language Runtime environment).

.Net even allows to inherit from a class written in another . Net language ( as long as certain rules are followed ).

Platform invoke feature ( managed code) allows code written in .Net to call and use code which were not written for .Net , such as win32 system calls.

Are you a MFC coder ? or does your current programs uses lot of COM components ?
No worries… .Net framework allows interoperability with COM. Means .Net components can call a COM component and COM component can call .NET components.


No COM Required
.Net framework will free you from the bondage of COM legacy. Since you will not need any of the following as in COM programming ( following are familiar for COM programmers… others just pass on J )

o IUnknown interface :
§ In COM all objects must implement the interface IUnknown.
§ All .Net objects are derived from a single class known as Object. Interface programming is never a central theme any more.
o Reference Counting :
§ Programmer no longer has to keep count of references to objects. Garbage collector keeps track of all references and it removes the inappropriate objects.

o HRESULT :
§ Atleast some of you might have seen this word. It shows up when errors occur in COM. HRESULT data type is used for returning runtime error codes.
§ In .Net its no longer used, instead all runtime errors produces exceptions. And of course, we can handle all these exceptions in the code.

o Registry settings:
§ If you have developed any application and deployed using any other .Net languages, you knows the headache that comes with registry.
§ .Net simplifies the deployment ( both installation and removal) of programs , not using operating system configurations or application configurations in the registry.
Simplified Deployment


Oops.. I have to tell the same thing here.. “.Net simplifies deployment because it seldom uses registry settings. ”
One good advantage is the side-by-side execution of different versions of a DLL. Earlier DLLs were used based on their names. But .Net applications uses only that DLL for which it was built.
Type Safety


Its CLR again.. CLR checks for type safety of parameters and data objects used in .NET


An overview:
Well, I will give you an overview of Compilation and Execution process in .Net.



Compilation and Execution process is same regardless of the Language of the original Source file.

Hmmm… two type of compilations.. CIL and Native code compilations… will explain more later…

Monday, April 28, 2008

Some basics of Microsoft .NET - Part 1

Some basics of Microsoft .NET
Microsoft.net is out since 2002… may be too late to mention basics now… but still it interesting to have an overview of what we learned.

.Net Framework is a much more consistent and object-oriented environment than either the MFC or COM programming technologies. In short we can say it has three basic features..
· Multiple platform: .Net Framework runs on a broad range of computers, from servers and desktop machines to PDAs and cell phones.
· Industry standards: The system uses industry standard communication protocols, such as XML, HTTP, SOAP, and WSDL.
· Security: The system can provide a much safer execution environment, even in the presence of code obtained from suspect sources.

.Net Framework mainly have three main components.


Main execution environment is known as CLR ( common Runtime Environment). CLR manages program execution at run time, and also it includes the following.
1. Memory management
2. Code safety verification
3. Garbage Collection
4. And Finally code execution

Programming tools is nothing but the tool used for making programs. It will be Visual Studio IDE for most cases. These tools also include debuggers, compliers etc.

The Base Class Library ( BCL) is a large class of Library used by .NET framework and which is used in .Net programming.

What are the benefits of using .NET Framework ?
Yes , since you have lot of platforms available that question is natural. .Net Framework is definitely an improved Programming environment.

Following are its features:
Object Oriented Development Environment.
Automatic Garbage collection
Interoperability
No COM Required
Simplified Deployment
Type Safety


Hmmm..
That’s for now… time is limiting to write more.. will update this blog next day..

Sunday, April 20, 2008

ASP.NET 3.5 - Anatomy ( for beginners)

ASP.Net 3.5
ASP.NET 3.5 is the next milestone in the evolution of Microsoft's ASP.NEt Platform. This time, this verison features AJAX, integration with the windows communication Foundation ( WCF ) service platform, Language INtegrated Query ( LINQ ) support and a few new server controls to fill existing functional gaps...

For Beginners:
What is ASP.NET?
Before asp.net, there were three main technologies and platforms for web development.
  1. ASP
  2. JSP
  3. LAMP ( open source web platform : Linux plus Apache plus MySQL plus either Perl, Python or PHP as the programming language)

Although each has a language-specific or platform specific features, all these were web development platforms designed to create interactive web pages rather than the lifeless simple HTML pages.

Like other web development environment ASP.NET also works on the top of HTTP protocol. But what differentiate it from other web development technologies is its abstract programming models.... ( the web forms model )

In addition the whole ASP.NET platform comes as part of Microsoft .NET Framework.
In short ASP.NET applications are compiled pieces of code, which can be written in first class languages ( like C#.NET, VB.NET, Jscript.NET, J# ) and which can access the entire classes in the .NET framework.


what is latest to come in future... ????
  • I have seen some whitepapers says ASP.NET will become a DLR ( dynamic Language runtime environment) when it supports programming languages like Python and Ruby. So ASP.NET is having a bright future... :)

Well as a programmer you need to know, more about the File extensions of ASP.NET applications.
  • .aspx => Files that represent ASP.NET Pages
  • .asmx => Files that implement .NET web services
  • .ascx => ASP.NET user control files.
  • .axd => file extension used for application level tracing ( trace.axd) or script level injection ( webresource.axd)
  • .ashx => HTTP handlers ( managed modules ) that interact with low level request and response services of IIS
  • .asax => ASP.NET application file such as Global.asax. This file cannot be requested directly.

In addition to this, .cs , .csproj, .vb, .vbproj, .config and .resx ( the typical Microsoft Visual Studio files) are also handled by ASP.NET.


Next time we will see how this files are requested and who handles those requests....

Post your comments and suggestions too... ;)