Posted by : Rhyf Ahmad Wednesday, May 13, 2015

Visual Basic is a fully object-oriented language. Chapter 3 covered the basics of creating classes and objects, including the creation of methods, properties, events, operators, and instance variables. You have seen the basic building blocks for abstraction, encapsulation, and polymorphism—concepts discussed in more detail at the end of this chapter. The final major techniques you need to understand are inheritance and the use of multiple interfaces.

Inheritance is the idea that you can create a class that reuses methods, properties, events, and variables from another class. You can create a class with some basic functionality, and then use that class as a base from which to create other, more detailed, classes. All these derived classes will have the same common functionality as that base class, along with new, enhanced, or even completely changed functionality. This chapter covers the syntax that supports inheritance within Visual Basic. This includes creating the base classes from which other classes can be derived, as well as creating those derived classes. Visual Basic also supports a related concept: multiple interfaces. As shown in Chapter 3, all objects have a native or default interface, which is defined by the public methods, properties, and events declared in the class. These additional interfaces define alternative ways in which your object can be accessed by providing clearly defined sets of methods, properties, and events. Like the native interface, these secondary interfaces define how the client code can interact with your object, essentially providing a “contract” that enables the client to know exactly what methods, properties, and events the object will provide. When you write code to interact with an object, you can choose which of the interfaces you want to use; basically, you are choosing how you want to view or interact with that object. This chapter uses relatively basic code examples so that you can focus on the technical and syntactic issues surrounding inheritance and multiple interfaces. The last part of this chapter revisits these concepts using a more sophisticated set of code as you continue to explore object-oriented programming and how to apply inheritance and multiple interfaces in a practical manner. Successfully applying Visual Basic’s object-oriented capabilities requires an understanding of objectoriented programming. This chapter applies Visual Basic’s object-oriented syntax, showing how it enables you to build object-oriented applications. It also describes in detail the four major objectoriented concepts: abstraction, encapsulation, polymorphism, and inheritance. By the end of this chapter, you will understand how to apply these concepts in your design and development efforts to create effective object-oriented applications.

Contents:

Inheritance
  1. When to Use Inheritance
  2. Implementing Inheritance
  3. Interacting with the Base Class, Yourself, and Your Class
  4. Constructors
  5. Object Scope
  6. Events and Inheritance
  7. Shared Methods
  8. Creating an Abstract Base Class

Multiple Interfaces
  1. Object Interfaces
  2. Abstract Interfaces

Abstraction
Encapsulation
Polymorphism
  1. Method Signatures
  2. Implementing Polymorphism



Ebook Preview
Get the ebook now (850 kB)

If the link above doesn't work, try the link below


Mirror: Get the ebook now (850 kB)

Leave a Reply

You can leave a comment to request any article(s), software(s), ebook(s) or report the dead link.
Then I will reply as soon as I can :)

Subscribe to Posts | Subscribe to Comments

Welcome to My Blog

Recent Post

Recent Posts Widget
Instagram

- Copyright © Madriva -Robotic Notes- Powered by Blogger - Designed by Johanes Djogan -