Tuesday, June 12, 2012

Components of DOT.NET platform


Introduction


The basic components of .NET platform (framework) are:










                  .Net Applications

        (Win Forms,Web Applications,Web Services)


         Data(ADO.Net) and XML Library

          FrameWork Class Library(FCL)      

        (IO,Streams,Sockets,Security,Reflection,UI)


       Common Language Runtime(CLR)

             (Debugger,Type Checker,JITer,GC)


                    Operating System

(Windows,Linux,UNIX,Macintosh,etc.,)




Concept of Assembly in DOT.NET

What is a .Net Assembly?

The .NET assembly is the standard for components developed with the Microsoft.NET. Dot NET assemblies may or may not be executable, i.e., they might exist as the executable (.exe) file or dynamic link library (DLL) file. All the .NET assemblies contain the definition of types, versioning information for the type, meta-data, and manifest. The designers of .NET have worked a lot on the component (assembly) resolution.


There are two kind of assemblies in .NET;





  • Private


  • Shared/Public

Abstract Vs Interface

Introduction


In this article along with the demo project I will discuss Interfaces versus Abstract classes. The concept of Abstract classes and Interfaces is a bit confusing for beginners of Object Oriented programming. Therefore, I am trying to discuss the theoretical aspects of both the concepts and compare their usage. And finally I will demonstrate how to use them with C#.



Background


An Abstract class without any implementation just looks like an Interface; however there are lot of differences than similarities between an Abstract class and an Interface. Let's explain both concepts and compare their similarities and differences.



What is an Abstract Class?


An abstract class is a special kind of class that cannot be instantiated. So the question is why we need a class that cannot be instantiated? An abstract class is only to be sub-classed (inherited from). In other words, it only allows other classes to inherit from it but cannot be instantiated. The advantage is that it enforces certain hierarchies for all the subclasses. In simple words, it is a kind of contract that forces all the subclasses to carry on the same hierarchies or standards.

Why do we need Constructor for abstract class?

Yes we can have constructor in Abstract class (though we can’t still create object of abstract class).
Because :- this way you can instantiate the data in abstract class.
And inherited classes can call the base constructor.

public abstract class A{
private string data;
protected A(string myString){
data = myString;
}
}

public class B : A {

B(string myString) : base(mystring){}
}

NOTE:- As you can’t override constructor, so we can’t have abstract constructor.

Top 10 features of SQL Server 2008

Introduction


                      I this article i am going to describe top 10 features of SQL Server 2008 database.


Description


10.  Plug-in model for SSMS.   SSMS 2005 also had a plug-in model, but it was not published, so the few developers that braved that environment were flying blind.  Apparently for 2008, the plug-in model will be published and a thousand add-ins will bloom.


9.  Inline variable assignment.  I often wondered why, as a language, SQL languishes behind the times.  I mean, it has barely any modern syntactic sugar.  Well, in this version, they are at least scratching the the tip of the iceberg.


Instead of:




DECLARE @myVar int
SET @myVar = 5


you can do it in one line:




DECLARE @myVar int = 5


Sweet.