Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Name for a hosting class - Just looking for some naming ideas

Name for a hosting class - Just looking for some naming ideas

Scheduled Pinned Locked Moved C / C++ / MFC
hostingtoolsquestion
4 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • B Offline
    B Offline
    bob16972
    wrote on last edited by
    #1

    - 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?

    C 1 Reply Last reply
    0
    • B bob16972

      - 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?

      C Offline
      C Offline
      Code o mat
      wrote on last edited by
      #2

      How about m_container or maybe m_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<

      B 1 Reply Last reply
      0
      • C Code o mat

        How about m_container or maybe m_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<

        B Offline
        B Offline
        bob16972
        wrote on last edited by
        #3

        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. ;)

        C 1 Reply Last reply
        0
        • B bob16972

          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. ;)

          C Offline
          C Offline
          Code o mat
          wrote on last edited by
          #4

          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<

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups