Name for a hosting class - Just looking for some naming ideas
-
- Consider a class that is used as a utility by many of your classes. - The classes that can use it (I'm calling it the host or parent class for now) must, derive from some abstract base class . - When you instantiate the utility class, the constructor takes a reference to the host or parent class so it can call the base class methods the hosts are required to implement. This reference is stored as a member in the utility class object instance. (NOTE: lifetime issues are taken care of properly since the utility class object is a member of the host but that is unrelated) What do you refer to this member variable (reference) for the hosting class as? I've been using... m_parent m_host However, I'm wondering if these don't convey the relationship properly. What terms do some of you use for such a relationship?
-
- Consider a class that is used as a utility by many of your classes. - The classes that can use it (I'm calling it the host or parent class for now) must, derive from some abstract base class . - When you instantiate the utility class, the constructor takes a reference to the host or parent class so it can call the base class methods the hosts are required to implement. This reference is stored as a member in the utility class object instance. (NOTE: lifetime issues are taken care of properly since the utility class object is a member of the host but that is unrelated) What do you refer to this member variable (reference) for the hosting class as? I've been using... m_parent m_host However, I'm wondering if these don't convey the relationship properly. What terms do some of you use for such a relationship?
How about
m_container
or maybem_utilizer
?> The problem with computers is that they do what you tell them to do and not what you want them to do. < > //TODO: Implement signature here<
-
How about
m_container
or maybem_utilizer
?> The problem with computers is that they do what you tell them to do and not what you want them to do. < > //TODO: Implement signature here<
-
thanks. I sometimes wish there was a programmers thesaurus to help find meaningful class and variable names that match intent. MS Word thesaurus only goes so far. ;)
Or at least an online random class/variable name generator similar to these[^], it could spit out smart-sounding names like: m_denominatorEqualizerFactor or somesuch. :)
> The problem with computers is that they do what you tell them to do and not what you want them to do. < > //TODO: Implement signature here<