Chapter 6. VB.NET in the .NET Framework

Team-Fly    

 
Application Development Using Visual Basic and .NET
By Robert J. Oberg, Peter Thorsteinson, Dana L. Wyatt
Table of Contents
Part 2.  VB.NET Language


VB.NET as a language has become much more elegant and powerful than previous versions of Visual Basic. To fully use its capabilities, you need to understand how it works within the .NET Framework. We begin with the root class Object . Collections are examined next , including the methods of the Object class that should be overridden to tap into the functionality provided by the .NET Framework. We then introduce interfaces, which allow you to rigorously define a contract for a class or structure to implement. In VB.NET a class can implement multiple interfaces, even though it can inherit implementation from only one class. Interfaces allow for dynamic programming. You can even query a class at runtime to see whether it supports a particular interface.

The interfaces supporting collections are examined in detail. We investigate issues involved in copying objects, such as shallow copy and deep copy. To support the copying of objects in VB.NET, you implement the ICloneable interface. We explore generic interfaces in the .NET Framework programming model and compare the .NET and COM component models. A further illustration of generic interfaces is provided by sorting in different orders with the IComparable interface. The examples offer insight into the workings of frameworks, which are more than class libraries. In a framework, you call the framework, and the framework calls you. Your code can be viewed as the middle layer of a sandwich. This key insight can help you grasp what makes .NET programming "tick." VB.NET uses this concept in delegates and events. Two simple and intuitive examples are presented: a stock market simulation and an online chat room. The chapter concludes with a discussion of attributes, which are pervasive in the .NET Framework.


Team-Fly    
Top
 


Application Development Using Visual BasicR and .NET
Application Development Using Visual BasicR and .NET
ISBN: N/A
EAN: N/A
Year: 2002
Pages: 190

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net