Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Object Oriented Programming - how to? 2

Status
Not open for further replies.

x508

Programmer
Jun 26, 2003
396
ZA
Hi

Can you please help me to clarify what exactly OOP, COM and DCOM is and how, where it works?

My impression of OOP is this:

Instead of using fixed values to do stuff, use variables in order to make whatever your doing independable of other stuff

I.E.

istead of using "c:\blabla", use App.Path ???

On COM I understand that it is reusable code, i.e dll's, OCX's etc.

DCOM ---->> No idea??

Of course what I have written here, is what I have been telling myself......and it might not be even close to the truth!!!

Please provide your opinions on the subject

Thanks in advance



*****************************************
May the Code Be With You...[lightsaber]
----------
x50-8 (X Fifty Eigt)
 
OOP is more than that...

It's a whole philosophy of tying your code to the data it operates on, and preventing other code from getting near it.

It's also about extending what you already have, though inheritence. But VB doesn't do that.

It's about reusability...

It's about polymorhism, which is too advanced a topic to lay down in one post here...


Hope this has given you some hints...

mmilan
 
OOP is a programming technique & philosophy. COM is a code packaging technology. DCOM is a technology that allows you to access COM components remotely, over a network (The "D" stands for "Distributed").

You can use OOP to write COM components, but you can (and this is the sad, but typical case) use non-OOP code in writing your COM components.

You can't do true OOP programming in VB6, but you can do 85-90% of it. Unfortunately, I don't know of a good book to recommend for VB6 O-O design -- the closest I can come up with is Bruce Eckel's "Thinking in Java". One of the best O-O books ever. Hopefully he'll come out with a C# or Vb.NET version soon.

Chip H.


If you want to get the best response to a question, please check out FAQ222-2244 first
 
thanks to all

*****************************************
May the Code Be With You...[lightsaber]
----------
x50-8 (X Fifty Eigt)
 
The term OOPS has nothing to do with the last letter S. The S was simply used as in a verbal conversation as in asking (eg: "Do you program in OOPS?").

So, lets leave the S out and just look at OOP.

OOP is O.O.P = Object Oriented Programming

Object Oriented Programming is exactly what we do in Visual Basic. If you want to get right inside deeper into lower level programming to see how Objects are created, you'd need to learn Asembly language or even C lower level version.

Consider an Apple, what you see is the skin (outter surface). This is what your users see when working with your applications. They only use the skin.

When you're programming in Visual Basic you go deep inside (under the skins' surface), and start using it's properties as in (eg: color). An Object is (eg: Command1) or (eg: Picture1).

This can go on for hours but I think you'd know what I mean.

 
We do use OOP to an extent with VB, but to claim that OOP is exactly what we do in VB is, for me, a bit of a stretch.

VB is designed to be a RAD tool - or Rapid Application Development. The whole point of VB is that you don't go under the skin of the apple... If you're dealing with a textbox for example, you don't really want to be bothered with the API functions required to update / display it. All you're interested in is a nice little .Text property, after which the object is left to pretty much look after itself.

VB's support for True OOP is flawed to say the least. Inheritence is just not on the cards, and polymorphism (through the implements command) is limited at best. Encapsulation - well OK, it has that.

2 out of three wouldn't be bad, but 1 out of 3 is a bit poor.

mmilan

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top