Summary

Team-Fly    

 
Application Development Using Visual Basic and .NET
By Robert J. Oberg, Peter Thorsteinson, Dana L. Wyatt
Table of Contents
Chapter 6.  VB.NET in the .NET Framework


This chapter explored several important interactions between VB.NET and the .NET Framework, beginning with the root class Object . We examined collections, including the methods of the Object class that should be overridden to tap into the functionality provided by the .NET Framework. We introduced interfaces, which allow you to rigorously define a contract for a class to implement. While a class in VB.NET can inherit from only one other class, it can implement multiple interfaces. Another benefit of interfaces is that they facilitate very dynamic programs. VB.NET provides convenient facilities to query a class at runtime to see whether it supports a particular interface.

The interfaces supporting collections were examined in detail, and copy semantics were explored. While C++ relies on its copy constructor language feature, in VB.NET you provide the capability by implementing a special interface, ICloneable . This led to an exploration of the role of generic interfaces in the .NET Framework programming model and to a comparison of the .NET and COM component models. A further illustration of programming with generic interfaces was provided by sorting in different orders with the IComparable interface. The examples offered insight into the workings of frameworks, which are more than just 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.

This behavior of being called into has been around for a long time in the form of callback functions. The chapter included a careful examination of delegates and events. Delegates are the underlying mechanism used in events. VB.NET allows you to program for events using both dynamic event handling and static event handling. Two simple and intuitive examples were presented: a stock market simulation and a chat room.

Finally, we covered attributes, which can be used to modify the behavior of entities of our program according to our specifications.

This chapter concludes our exploration of the VB.NET programming language. In the next chapter we begin our detailed examination of the .NET Framework with a study of user interface programming using Windows Forms.


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