VB'NET Applying Objects - PowerPoint PPT Presentation

1 / 13
About This Presentation
Title:

VB'NET Applying Objects

Description:

Called method must have same method signature. Slower than early binding. ... Child class provides expected method signature. Intro to VB.NET. 11. Inheritance ... – PowerPoint PPT presentation

Number of Views:62
Avg rating:3.0/5.0
Slides: 14
Provided by: richardv9
Category:

less

Transcript and Presenter's Notes

Title: VB'NET Applying Objects


1
VB.NET Applying Objects
  • Richard Vantrease

2
Introduction
  • Using VB.NET to create application objects
    through polymorphism and inheritance.

3
Agenda
  • Encapsulation
  • Polymorphism
  • Inheritance

4
Encapsulation
  • Separating interface from implementation.
  • Creating a black box so that developers do not
    know or care about the implementation, just the
    interface.

5
Polymorphism
  • Late Binding
  • Multiple Interfaces
  • .NET Reflection
  • .NET Reflection Multiple Interfaces
  • Polymorphism with Inheritance

6
Late Binding
  • Object variable is declared without a specific
    type, just uses Object type.
  • Cannot be used with Option Strict. Option must
    be turned off in the module file.
  • Called method must have same method signature.
  • Slower than early binding.
  • Errors might be missed until run-time.

7
Multiple Interfaces
  • Object variable is declared with using a specific
    type.
  • Known as strongly typed.
  • Interface is known by compiler which helps the
    IDE catch errors sooner.
  • Faster than late binding.
  • Use with caution and document well as it may
    cause confusion.

8
.NET Reflection
  • Interrogates .NET external assembly at run-time
    to determine its classes and interfaces.
  • Automatically used by Late Binding technique.
  • Similar to Late Binding in that interface is not
    really available until compile time.

9
.Net Reflection Multiple Interfaces
  • Adds strong typing to .NET Reflection.
  • Allows the interface to be known even if the
    external assembly is not.

10
Polymorphism with Inheritance
  • Another form of polymorphism.
  • Child class provides expected method signature.

11
Inheritance
  • Base class is created to define the common
    interface and functionality.
  • Child class inherits part of its interface and
    functionality and then extends it to meet the
    needs of its object.
  • It is possible to use multiple inheritance where
    a child class inherits from more than one base
    class.

12
Framework
  • Base classes that are not specific to any
    application, but provide base/common
    functionality only.

13
Summary
  • While powerful Polymorphism and Inheritance must
    be used carefully and with caution. Can cause
    confusion, or might limit later development.
Write a Comment
User Comments (0)
About PowerShow.com