Thursday, October 19, 2006

Partial classes

The new Partial keyword was introduced in .NET2.0 for both VB2005 and C#.

In a nutshell , partial classes mean that your class definition can be split into multiple physical files. Logically, partial classes do not make any difference to the compiler. At compile time it simply groups all the various partial classes and treats them as a single entity.

An awesome benefit of partial classes is that they allow a clean separation of business logic and the user interface (code generated by the visual studio designer).

The UI code can be hidden from the developer who normally doesnt need to access it anyways.

Partial classes also make debugging easier because of the partitioned classes. This is great for large develoment teams.

--Partial Class Default_aspx

--End Class

No comments: