INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Jobs

Encapsulation, Abstraction, Polymorphism & Inheritance

Encapsulation, Abstraction, Polymorphism & Inheritance

(OP)
I dont' quite understand the below:
1.) Encapsulation
2.) Abstraction
3.) Polymorphism
4.) Inheritance

I've probably used/created these before in my VB 6 experience (My company does not have .net) but I don't quite understand what each means so I'd like to give some examples of what I've done and maybe someone can explain if/where I've accomplished any of the above.

I created a DLL called AddressInfo.dll which accesses a DB2 table to provide address information.  This DLL is used on several machines.

There is one particular parameter which dictates what address is retrieved but over time it was decided we would need several types of addresses at the same time so I've created a couple classes from this dll called:
clsClientAddressInfo
clsExecuticeAddressInfo
clsCustomerAddressInfo

I also have a class to concatinate some of the address information called clsAddressInfo.  It uses a function called BuildAddressInfo.  I guess I could have done this with the DLL but at the time I created it, it was not required and I cannot just go and change the DLL.  In this class I might build the clsClientAddressInfo.Address by concatinating BuildAddressInfo.Address1 & ", " & BuildAddressInfo.Address2 & ", " BuildAddressInfo.CityStateZip.

Thanks for your help and whatever I have not done can you please explain using what I've already done to accomplish all four of the above?
 

RE: Encapsulation, Abstraction, Polymorphism & Inheritance

Of the 4, I'd say you've acheieved Encapsulation. This is basically 'information hiding' i.e not all of the methods/functions of your AddressInfo class are visible to all and sundry (it has some internal methods etc. that are declared as private I am assuming).

The purist's uses of Abstraction, Polymorphism and Inheritance within VB6 are limited as it's not a true object oriented langauge. It supports a version of Interface Inheritance (using the Implements keyword) but not Implementation Inheritance, it supports a form of Polymorphism through the aforementioned Implementing Interfacesand there is no Overloading so it doesn't support a huge part of Ad-Hoc Polymorphism.

Hope this helps

HarleyQuinn
---------------------------------
Black coat, white shoes, black hat, cadillac. The boy's a timebomb!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers: How to get the best answers before post

RE: Encapsulation, Abstraction, Polymorphism & Inheritance

Posted a bit quickly there, I was meant to finish by saying that even though you've probably only got one of the four, I wouldn't be too worried about not using the others if you don't fully understand them (and VB's limitations using them).

HarleyQuinn
---------------------------------
Black coat, white shoes, black hat, cadillac. The boy's a timebomb!

You can hang outside in the sun all day tossing a ball around, or you can sit at your computer and do something that matters. - Eric Cartman

Get the most out of Tek-Tips, read FAQ222-2244: How to get the best answers: How to get the best answers before post

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Resources

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close