I am building some material for OOP (object oriented programming) in VBA.
Can anybody list me the OOP concepts which are available in VBA?
For example, from my reading I discovered that:
- Inheritance is not available in VBA.
- The encapsulation concept is there, as you can use access modifier “private” and build a public property.
Here are some observations I’ve made while working with OOP concepts in VBA:
Class_Initializemethod that is called when the object is instantiated, but it cannot be overloaded to handle parameters. If you want to force your class to not be “fully functional” without having certain properties set, you’ll have to write your own way to do so.The VB6/VBA paradigm envisions classes as a way to encapsulate an object’s functionality and properties. In this sense, VB6/VBA’s objects exist just like any other basic OOP environment and their use and design should be encouraged where appropriate.
However, the lack of several key OOP features cause VB6/VBA to fall short in being able to thoroughly implement a complete OOP design pattern.