Advanced Access: Inheritance and Interfaces in VBA (I Was WRONG!)

preview_player
Показать описание
In this video called Inheritance and Interfaces in VBA (I Was WRONG!), software developer and programmer Steve Bishop demonstrates how to use Interfaces through inheritance in Visual Basic for Applications. Interfaces and inheritance are two concepts very often overlooked for the VBA development process.

This Advanced Access series is a collection of instructional videos designed to help you become better programmers in Microsoft Access. You will learn some of the more advanced techniques for software development in VBA and Microsoft Access.

For more information, please visit the following websites:
Рекомендации по теме
Комментарии
Автор

Hey there! I'm one of the co-founders of the project. First off, I'd like to say thank you for your kind words about our little ducky. I can't tell you how happy it makes me to hear people so excited about the plug-in.

I would like to correct a small point though. VBA doesn't have inheritance. The interface keyword enables polymorphism, but there isn't a way to inherit functionality from a base class.

Kindest Regards,
Rubberduck203

christophermcclellan
Автор

WoW WoW Wow ... I working 10 years at my own access project in now I see THIS!! unbelievable ...puuh this has a very big impact to the coding, type concept of implementation .... why I see it now ... I don't know. Thanks so much Steve.!!

Leonardo-ihiy
Автор

Thanks for the video - I have a specific problem that I'm working on right now that has just become a lot more manageable

martin-carlsson
Автор

Spectacular!!! This is definitely a game changer in my VBA journey. Cheers and Thanks

LuisBreak
Автор

Steve, dont have much knowledge about it though, but your excitement tells us its a big finding and I am interested in knowing out more. Looking forward to series dissecting finding with real examples/scenarios possible. How about clubbing Rubberduck finding with implementation of Uncle Bobs SOLID principles will be a solid video for MS Access Developers. Also looking forward to an Interview with the co-founder Christopher McClellan.

mustafasange
Автор

THANK YOU VERY MUCH for this video, I really apreciate this. Great explanation. Thanks from Barcelona (Catalonia)

TonnySanjiao
Автор

I love your ACCESS videos. They are so well done. You are a very good and patient teacher. +1

pirateman
Автор

Your video tutorials are great. I am finally getting to wrap my head around Interfaces, thanks to two of your tutorial. However, in this video you sing the praises of RubberDuck. I downloaded the latest version a few days ago. After installing it, my VBE slowed to a crawl and slower. I love what RubberDuck offers to do but can't tolerate its disastrous effect on writing code (tangible delay after most keystrokes). I understand a version is in the works to get around this problem but for now, no RubberDuck for me.

argeedb
Автор

oh man, you're one of the best professor that I ever have!

CristianCotrinaTezen
Автор

Thanks for the awesome feedback! I can't think of a good reason the refactoring wouldn't be creating the private stubs and keep the code compilable, we gotta fix that! note, the interface implementation members don't need to be public actually (not a bug!) - by making them public on DummyMsgClass you expose the IDummyMsgClass_Foo method, but it can very well (and should) remain private - in that case the member will only be accessible via the IDummyMsgClass interface... which should be the case anyway, if you're coding against these interfaces =)

rubberduckvba
Автор

Doea this mean we can’t take your access course? Is it okay to take it and then learn this oop?

ghadirfwz
Автор

I'm really struggling with understanding the power of the features you're describing. I guess I need to get my head into Classes more and understand some of the terminology better as I would create/use Functions in place of what you describe here. I've created an exact copy of the sample database you've run through so I can play with it but can you or anyone point me in the direction of a video that might help? Love your videos by the way and really appreciate the time taken to help folk like me. :) xx

LindaLooUK
Автор

Hey Steve,
Thanks again for the great vid.
One thought. You know how the () function implementation was set to Private by Rubberduck. Maybe that is OK.
If we deleted the function,
encapsulated in the concrete class a private constant Msg as string = "Steve is such a Legend",
we could privately
implement the public interface function from there, and not expose any methods at all on the concrete class. What do you think?

omgmadu
Автор

The private keyword is not a mistake. It is supposed to be that way. You are accessing the public property/method from the interface which is accessing it privately through the class via it's implementation. hence the "Implements" keyword. Declaring it publicly only makes it accessible via declaring the class either a DummyMessage or NotDummy Message. The cleaner way to achieve the same thing would be to declare a public function called "DummyMessage" in the DummyMessage or NotDummy message class and and then have the IDummyMessage_DummyMessage private function call this function. This would allow either the interface or the class modules access the same method without the annoying underscore. Also, I would declare it a property and not a function. Functions should be doing something. DummyMessage is a noun, not a verb. Great video though, thanks for showing me Rubber Duck.

data-science-ai
Автор

Me Steve I'm completely new to vba is it a good choice to start using rubber ducky in the begining..? And if so how do I start...? Kindly help.

krishnakumari
Автор

Hi Steve!
Can you explain the need of this implementation ... because these procedures you have showed in this video, are possible with the module, and I don't see why to work so hard just to display a message! :) .. may be the exemple of showing message didn't describe the advantage of the implementation....

sissokom.prodev
Автор

Hey Steve,
You've done a great set of videos on how to use ADODB to allow Access to speak directly to a backend, with no local tables.
Are you interested in doing some videos extending this? My goal is to create a set VBA classes that can be implemented from any office host (esp. Access, Word, Excel).
This is important to me because I have limted ability to install applications in my company computer system, but can run macro enabled office documents. Want to create a variety of different front ends in different hosts for my users that all update a backend accdb (ideally an SQL server but this is hard to implement at my current big org through IT).
Reallly excited about the idea of encapsulating my business logic in one place and using unbound views and or presenters.
Have seen the 'VB6 Tools' library developed by the Ruberduck guys and am keen for some demos on how an experienced OOP developer like yourself might implement those.
Cheers David.

omgmadu
Автор

So it does allow having interfaces. But I wonder whether it allows regular inheritance? For e.g. extending another class and its functionality as a whole and adding more functionality to it?

harisrg
Автор

Is there any possibility to add watermark text in background of reports not includes images
Same like watermark in word documents?

If anyone knows please help me

subbug
Автор

I haven’t had my aha moment yet! I think I understand what going on, but to echo other comments on here a more practical example would probably work better for me.

cormackeenan