How to access a data class's private member variable from another derived class whose parent class is a friend class of the data class?
Since you have declared struct PImpl in the private part of CDataHolder class, only friends of CDataHolder can access the same. Why don't you put a forward declaration struct PImpl in the public section or even better before the CDataHolder class?
source
Derived classes in C - What is your favorite method?
I know that GNOME uses the 2nd method, and casting pointers was a known thing as well. I don't remember there being any real hoops to jump through to do so. In fact, From a C memory model standpoint, there can't be any semantic difference between the two, since AFAIK the only possible difference would be compiler differences in structure padding, but since the code all runs through the same compiler, that would be a moot point.
source
How to allocate array in base constructor with size based on derived class?
I like both Earwicker and Steve's answers, depending on what's required. If there's many of these objects being created and destroyed frequently, then you want the minimum amount of memory allocation possible, and thus Earwicker's is superior. However, if this is something that's usually "created and rarely re-made" then I'd go with Steve's answer, as maps are just generally a lot easier to work with, and grow dynamically as needed, but is probably too much overhead if this object is something being made and destroyed a lot.
source
Is it possible to unimplement an interface in derived class in Java?
Maybe you have a specific case where a better solution could be devised, but for the generic case you need some black magic. Eventually Javassist could be used "hack" your objects but I'm not so sure.
source
Is it good form to expose derived values as properties?
I usually go by what the method or property will do. If it is something that is going to take a little time, I'll use a method. If it's very quick or has a very small number of operations going on behind the scenes, I'll make it a property.
source