Tuesday, May 24, 2011

Software Development Models

In Software Development process we have different models to adopt to complete the Project and sometimes combination of Development process also used in Development process.

We Have Basic Knowledge on Software Development Cycle 

if we adopt one process it makes easy to develop  Projects.

We Have Four Types Of Development Processes
They are

1.Water Fall Model
2.Spiral Model
3.Iterative and Incremental Development
4.Agile Development

Tuesday, May 10, 2011

Simple Linq To Sql Example

How to Use Linq to sql in dotnet ?

--Take the Class with same name of Database
--Than Inherit With Class DotContext
--For This Class u have to add Linq ,data,Mapping references to project

--Using System.Linq.Data;
--Using System.Linq.Data.Mppaing
Ex:

public class Mydatabase() :DotContext
{

}

Monday, May 9, 2011

Differecne Between Interfaces and Abstract ?

Differences between Interface and Abstract Class?
Interfaces :
--An interface is not a class.
--It is an entity that is defined by the word Interface.
--An interface has no implementation;
--it only has the signature or in other words, just the definition of the methods without the body. As one of the similarities to Abstract class
 ____________________________________
Public Interface ImyInterface

{
String Method1();
int Method2();

}
Public Class myClass :ImyInterface
{
string Method1()
{
//Code
}
int Method2()
{
//Code
}
}
____________________________________________________________________________
---Requires more time to find the actual method in the corresponding classes. (Slow )


The main difference between them is that a class can implement more than one interface but can only inherit from one abstract class. Since C# doesn't support multiple inheritance, interfaces are used to implement multiple inheritance

  Abstract Class:
   These Classes Cannot be instantiated, 
 ---These are used if additional functionality is needed in derived classes,
 ---These Implemented partially or No Implementation
--Fast In Operation
 ____________________________________________________________
abstract class MyAbstractClass
{
public MyAbstractClass()
{
// Code to initialize the class goes here.
}

abstract public void Method1();
abstract public void Method2(int A);
abstract public long Method3(int B);
}
class MyClass : MyAbstractClass
{
public MyClass ()
{
// Initialization code goes here.
}

override public void Method1()
{
// code goes here.
}

override public void Method2(int A)
{
// code goes here.
}

override public long Method3(int B)
{
//code goes here.
}
}


What is OOPS Concepts ?

OOPS Concepts 
   
Ans:  Object Oriented Programming (OOP) All Programming Language will support this OOP there are Three main concepts in OOP
   a)Encapsulation
   b)Abstraction
   c)Inheritance
   d)Polymorphism
Encapsulation  :
Encapsulation is the process of Keeping the data and method together into Objects
OR
Simple Putting Together into one simple class Like.
OR
Means that a group of related properties, methods, and other members are treated as a single unit or object.
_____________________________________________________________
Class My Class
{
public MyClass()
{

}
int a;
int b;
Public void GetAdd()
{
 int C=a+b;
}

}
____________________________________________________________

Abstraction : Hiding the Data
Inheritance:
Inheritance Enables  you to Create Class that Reuses
OR
Acquiring the Properties of Base Class(Parent Class)
OR
Means Provide Further Implementation ,Reusing of  Base Class
__________________________________________________________
Public Class MyClass
{
Public MyClass()
{
}
int a;
int b;
Public void GetMyMethod()
{
int c=a+b;
}
}
Public Class MyChildClass : MyClass
{
 Public MyChildClass()
{}
}
C# Doesn't Support Multiple Inheritance By Using Interfaces We Can 


Polymorphism
Polymorphism means same operation may Behave Differently in Different Classes

Example of Compile Time Polymorphism: Method Overloading
Example of Run Time Polymorphism: Method Overriding

Method Overloading- Method with same name but with different arguments is called method overloading.
- Method Overloading forms compile-time polymorphism.
- Example of Method Overloading:
class MyClass
{
Public string hello()
{
return "Hello";
}
public string hello(string s)
{
return "Hello"+S.Tostring();
}
}

Method Overriding- Method overriding occurs when child class declares a method that has the same type arguments as a method declared by one of its superclass.
- Method overriding forms Run-time polymorphism.
-Virtual Key word is required for Overriding
- Example of Method Overriding:
Public Class MyClass
{
virtual void hello()
{
Console.WriteLine(“Hello from MyClass”);
}
}
Public Class MyChildchild : MyClass
{
override void hello()
{
Console.WriteLine(“Hello from Child”); }
}
}________________________________________________

What is the Difference Between Script Manager and Script Manager Proxy ?

What is the difference between Script Manager and ScriptManager Proxy ?
ans : A page can contain only one scriptmanager control. if you have a master content page in ur application and  the master  contains a script manager control, then you can use the scriptmanager proxy control to add script to content pages


Also, If you come across scenario where only a few pages in your application need to register to script or a web service, then its best to remove them from the script manager control and add them to individual pages, by using the script manager proxy control. that is because if you added the scripts using the script manager on the master page, then these items will be downloaded on each page that derives from the masterpage, even if they are not needed, which would lead to waste of resources.