SVN ,Constant vs Readonly ,Encapsulation Just View

SVN :
Subversion is a open source version control and license
free tool.That is, Subversion manages
files and directories, and the changes made to
them,overtime.all project files and modification stored in repository
from svn  recover the olderversion of files  and remembers the svn
changes
Constant :
Must have compilation-time value (i.e.: you can have "A"+"B" but cannot have method calls)
■Could be declared within functions
■Can be used in attributes
C#'s const vs. readonly
A quick synopsis on the differences between 'const' and 'readonly' in C#:
'const':
•Can't be static.
•Value is evaluated at compile time.
•Initiailized at declaration only.
public const double PI = 3.14159;
'readonly':
•Can be either instance-level or static.
•Value is evaluated at run time.
•Can be initialized in declaration or by code in the constructor.
public readonly double PI = 3.14159;
NEED FOR ENCAPSULATION:

Encapsulation provides a way to protect data from accidental corruption. Rather than defining the data in the
form of public, we can declare those fields as private. The Private data are manipulated indirectly by two ways.
Let us see some example programs in C# to demonstrate Encapsulation by those two methods.
The first method is using a pair of conventional accessor and mutator methods. Another one method is using a named property.
 Whatever be the method our aim is to use the data with out any damage or change.
ENCAPSULATION USING ACCESSORS AND MUTATORS:
Let us see an example of Department class. To manipulate the data in that class (String departname) we define an accessor (get method) and mutator (set method).
using system;
public class Department
{
private string departname;
.......
// Accessor.
public string GetDepartname()
{
return departname;
}
// Mutator.
public void SetDepartname( string a)
{
departname=a;
}
}

Like the above way we can protect the private data from the outside world. Here we use two separate methods to assign and get the required data.
public static int Main(string[] args)
{
Department d = new Department();
d.SetDepartname("ELECTRONICS");
Console.WriteLine("The Department is :"+d.GetDepartname());
return 0;
}
In the above example we can't access the private data departname from an object instance. We manipulate the data only using those two methods.
ENCAPSULATION USING PROPERTIES:
Properties are a new language feature introduced with C#. Only a few languages support this property. Properties in C# helps in protect a field in a class by reading and writing to it. The first method itself is good but Encapsulation can be accomplished much smoother with properties.
Now let's see an example.
using system;
public class Department
{
private string departname;
public string Departname
{
get
{
return departname;
}
set
{
departname=value;
}
}
}
public class Departmentmain
{
public static int Main(string[] args)
{
Department d= new Department();
d.departname="Communication";
Console.WriteLine("The Department is :{0}",d.Departname);
return 0;
}
}
From the above example we see the usage of Encapsulation by using properties. The property has two accessor get and set. The get accessor returns the value of the some property field. The set accessor sets the value of the some property field with the contents of "value". Properties can be

Comments