Posted by : Rhyf Ahmad Wednesday, May 13, 2015

This chapter takes you through the basic syntax of Visual Basic. With its transition many years ago to .NET, Visual Basic like all native .NET languages, became an object-oriented language. At the time this was a major transition, and even now you continue to talk about how Visual Basic supports the four major defining concepts required for a language to be fully object-oriented:

  1. Abstraction—Abstraction is merely the ability of a language to create “black box” code, to take a concept and create an abstract representation of that concept within a program. A Customer object, for instance, is an abstract representation of a real-world customer. A DataTable object is an abstract representation of a set of data.
  2. Encapsulation—Encapsulation is the concept of a separation between interface and implementation. The idea is that you can create an interface (public methods, properties, fields, and events in a class), and, as long as that interface remains consistent, the application can interact with your objects. This remains true even when you entirely rewrite the code within a given method—thus, the interface is independent of the implementation. The publicly exposed interface becomes what is known as a contract. It is this contract that you will look to limit changes to for those who consume your objects. For example, the algorithm you use to compute pi might be proprietary. You can expose a simple API to the end user, but hide all the logic used by the algorithm by encapsulating it within your class. Later if you change that algorithm, as long as the consumers of your object get the same results from your public interface, they won’t need to make changes to support your updates. Encapsulation enables you to hide the internal implementation details of a class.
  3. Polymorphism—Polymorphism is refl ected in the ability to write one routine that can operate on objects from more than one class—treating different objects from different classes in exactly the same way. For instance, if both the Customer and the Vendor objects have a Name property and you can write a routine that calls the Name property regardless of whether you are using a Customer or Vendor object, then you have polymorphism. Visual Basic supports polymorphism in two ways—through late binding (much like Smalltalk, a classic example of a true object-oriented language) and through the implementation of multiple interfaces. This fl exibility is very powerful and is preserved within Visual Basic.
  4. Inheritance—Inheritance is the concept that a new class can be based on an existing class gaining the interface and behaviors of that base class. The child or subclass of that base or parent class is said to inherit the existing behaviors and properties. The new class can also customize or override existing methods and properties, as well as extending the class with new methods and properties. When inheriting from an existing class, the developer is implementing a process known as subclassing.


Object-Oriented Terminology
  1. Objects, Classes, and Instances
  2. Composition of an Object
  3. System.Object

Working With Visual Basic Types
  1. Value and Reference Types
  2. Primitive Types

Commands: Conditional
  1. If Then
  2. Comparison Operators
  3. Select Case

Value Types (Structures)
  1. Boolean
  2. Integer Types
  3. Unsigned Types
  4. Decimal Types
  5. Char and Byte
  6. DateTime

Reference Types (Classes)
  1. The Object Class
  2. The String Class
  3. The DBNull Class and IsDBNull Function

Parameter Passing
  1. ParamArray
  2. Variable Scope

Working with Objects
  1. Objects Declaration and Instantiation
  2. Object References
  3. Early Binding versus Late Binding
  4. Data Type Conversions
  5. Performing Explicit Conversions

Creating Classes
  1. Basic Classes
  2. Handling Events
  3. Handling Multiple Events
  4. The WithEvents Keyword
  5. Raising Events
  6. Declaring and Raising Custom Events
  7. Receiving Events with WithEvents
  8. Receiving Events with AddHandler
  9. Constructor Methods

Object-Oriented Concepts
  1. Overloading Methods
  2. Overloading Constructor Methods
  3. Shared Methods, Variables, and Events
  4. Operator Overloading
  5. Delegates 

Ebook Preview
Get the ebook now (909 kB)

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

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

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