A Note for VB 6 Programmers

 
Appendix A - Principles of Object-Oriented Programming
bySimon Robinsonet al.
Wrox Press 2002
  

If you are a skilled Visual Basic 6 developer, but do not have C++ or Java experience, then you will find many of the concepts in this chapter completely new. Visual Basic does allow you to code something that is often referred to as an object: the VB class module. Some texts even refer to this as involving object-oriented programming, although this actually bears little resemblance to the original concepts of OOP. It is more accurate to say that VB implements a few of the more basic features of OOP. A VB class module is essentially a COM component, but wrapped up 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.

When you start reading this Appendix you'll probably think at first that we're just describing what you're used to in the class modules. However, 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 will need to read this chapter. 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, so you'll find once you're comfortable with the concept, you'll be structuring your programs in a completely different way to how you would have done in VB, and your programs will be easier for others to maintain as a result. If, however, you do already feel very comfortable with manipulating objects in VB, but have not yet used inheritance, you may want to skip straight to the section on inheritance.

Note that whenever we refer to "VB" or "Visual Basic" in this Appendix, we are more specifically referring to VB 6.

  


Professional C#. 2nd Edition
Performance Consulting: A Practical Guide for HR and Learning Professionals
ISBN: 1576754359
EAN: 2147483647
Year: 2002
Pages: 244

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