0

Inheritance and interface in shared DLL

Hi We can define a class as interface and share solution to the team who can develop the implementation of the methods define in the interface class..... Does this behaviour work even if we don't have implementation in my own DLL and my own DLL don't know what would be class name team would be implementing and how many classes... To be precise , let me give some example... Shape is my interface and I would like to call all shape class area methods ... How to implement this behaviour...? I could ask team to export area methods which take pointer of their class and my area method is taking interface pointer as argument... Is this correct ? Still how I would ensure that all class methods whatever team define should be called from my framework... I am sorry but I am not able to connect dots now.... Something simillar I would like to understand..feel free to ask for query.

10th Aug 2020, 3:15 PM
Ketan Lalcheta
Ketan Lalcheta - avatar
1 Answer
+ 1
I've only done this with a c++ webserver where dynamic request handlers were implemented in DSOs. The request handler had an abstract base class and a factory was used to get the implementation. Inotify was used to load/unload the implementations at runtime on a background thread. Have you read this? This one actually does the shapes example https://www.linuxjournal.com/article/3687 In reading this question I also came across this interesting paper: http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2006/n2015.pdf The above paper is actually mentioned in this useful DrDobbs article: https://www.drdobbs.com/cpp/building-your-own-plugin-framework-part/204202899
11th Aug 2020, 2:47 PM
Ockert van Schalkwyk
Ockert van Schalkwyk - avatar