Facebook Twitter Gplus LinkedIn YouTube Google Maps RSS
Home Posts tagged "oops" (Page 2)
formats

Inheritance, Polymorphism

Harness the added power of VB.NET’s inheritance capabilities by exploring subclassing, polymorphism, dynamic typecasting, and interface definitions.

In This Chapter

  • Inheritance Basics
  • What Is Inheritance?
  • Defining Classes That Must Be Subclassed
  • Defining Classes That Cannot Be Subclassed
  • Polymorphism
  • Dynamic Typecasting
  • Defining Interfaces
  • Summary

Visual Basic .NET supports inheritance. VB6 did not. VB6 supported interface implementation, which is a facility of the Component Object Model (COM). Why Microsoft chose to implement COM and interfaces before classes and inheritance is anybody’s guess, but Visual Basic .NET supports both interfaces and inheritance. The net result is that Visual Basic .NET is significantly more powerful and has features and capabilities consistent with the most advanced languages available today.

 
Tags:
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

OOPS again

Object Oriented Programming Language Features

This article describes the basic features involved in Object Oriented Programming (OOP) languages in general and how they are implemented in Visual Basic. It is by no means an all inclusive, definitive reference but does serve to describe some of the typical features considered to comprise an object oriented language. It may be a good starting point for less experienced programmers.

Object oriented features are typically lumped into 2 categories. The first includes the biggies: Polymorphism, Inheritance and Encapsulation (PIE). The second includes other features such as operation overloading, parameterized constructors and class-level attributes and operations.

 
Tags:
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Encapsulation

Encapsulation is the exposure of properties and methods of an object while hiding the actual implementation from the outside world. In other words, the object is treated as a black box—developers who use the object should have no need to understand how it actually works.

Encapsulation is the programmatic equivalent of a black box. An actual black box may have a switch and dials. Inside the box would be the mechanisms to perform the actions provided by the black box.

 
Tags:
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Abstract vs Interface

Introduction

In this article along with the demo project I will discuss Interfaces versus Abstract classes. The concept of Abstract classes and Interfaces is a bit confusing for beginners of Object Oriented programming. Therefore, I am trying to discuss the theoretical aspects of both the concepts and compare their usage. And finally I will demonstrate how to use them with C#.

Background

An Abstract class without any implementation just looks like an Interface; however there are lot of differences than similarities between an Abstract class and an Interface. Let’s explain both concepts and compare their similarities and differences.

 
Tags:
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
formats

Abstraction

ABSTRACTION:

I am still confused. Some say it is hiding non essential data and focusing on important data. Others say it is the ability to generalize specific set of characteristics(properties) and actions (methods).

If i start using hiding, I am sure the interviewer will ask about the differences between abstraction and encapsulation.

Abstraction is “the process of identifying common patterns that have systematic variations; an abstraction represents the common pattern and provides a means for specifying which variation to use” (Richard Gabriel).
Example:

Abstraction means that you have some class that is more common than others that extend it. By example, if you have classes Triangle and Rectangle:

 
Tags:
 Share on Facebook Share on Twitter Share on Reddit Share on LinkedIn
No Comments  comments 
© All rights reserved to Cyberbrutus. 2012
credit

Switch to our mobile site