A Note For Visual Basic 6 Programmers


If you are a skilled Visual Basic 6 developer but do not have C++ or Java experience, many of the concepts in this chapter will strike you as "foreign." Visual Basic does allow you to code something that is often referred to as an object: the Visual Basic class module. Some texts even refer to this as involving OOP, although this bears little resemblance to the original concepts of OOP. It is more accurate to say that Visual Basic implements a few of the more basic features of OOP. A VB class module is essentially a COM component but wrapped in a way that hides much of what it does. In particular, it does not support inheritance of its methods in the same way that inheritance is used in C# and conventional OOP.

Because of its support for a different kind of inheritance (implementation inheritance), C# classes are much more powerful than VB class modules and are often used very differently. If you want to write good C# .NET applications and assemblies, you must read this appendix. Objects and inheritance are not just new language features. In a well-designed object-oriented program, the whole architecture of the program is often arranged around inheritance. Once you're comfortable with the concept of OOP, you'll be structuring your programs in a completely different way from what you have done in Visual Basic — and your programs will be easier for others to maintain as a result. However, if you already feel comfortable with manipulating objects in Visual Basic but have not yet used inheritance, you might want to skip ahead to the section on inheritance.

Note

Note whenever Visual Basic is referred to in this appendix, it is more specifically referring to Visual Basic 6.




Professional C# 2005
Pro Visual C++ 2005 for C# Developers
ISBN: 1590596080
EAN: 2147483647
Year: 2005
Pages: 351
Authors: Dean C. Wills

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