Patrick O'Dea
asked on
Quickie! Is Microsoft Access VBA an Object Orientated Programming
I have never properly understood what OOP is.
I can and do program VBA in Access.
Is this OOP??
I can and do program VBA in Access.
Is this OOP??
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Like Jim said ... it's not a true OOP based on a strict definition.
However ... it's close enough for me :-)
mx
However ... it's close enough for me :-)
mx
Specifically at it's simplest, VBA lacks full inheritance. You can't build a class on top of a class and extend it.
That's what an OOP language allows. A simple example; a text control. sub-types might be text, numeric, and date/time.
In an oop language, I would have a base class of "text box" and then build three new classes off that. Within my program, I would create instances using the sub-types. If I made a change in the base class later (say to select the contents on gotfocus), that would be reflected in all the sub classes (You inherit all properties, events, and methods of your base class). This gives you a class hierarchy (think of a family tree).
Nothing like that exits in VBA. I can make a copy of an object and modify that, but it's unrelated to the original.
There's a little more to it then that, but that's it in a nutshell.
Jim.
That's what an OOP language allows. A simple example; a text control. sub-types might be text, numeric, and date/time.
In an oop language, I would have a base class of "text box" and then build three new classes off that. Within my program, I would create instances using the sub-types. If I made a change in the base class later (say to select the contents on gotfocus), that would be reflected in all the sub classes (You inherit all properties, events, and methods of your base class). This gives you a class hierarchy (think of a family tree).
Nothing like that exits in VBA. I can make a copy of an object and modify that, but it's unrelated to the original.
There's a little more to it then that, but that's it in a nutshell.
Jim.
ASKER
I guess I don't know OOP - better change my CV!