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 that pattern or patterns...

Name that pattern or patterns...

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++regex
5 Posts 2 Posters 1 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.
  • A Offline
    A Offline
    alex barylski
    wrote on last edited by
    #1

    You know that helper macro in MFC (pardon my ignorance but I haven't used MFC in probalby 6-7 years) that is used for creating object at runtime, used in Views, I think it's RUNTIME_CLASS or something??? What is the name of the closest pattern for that implementation, obviously it's not a singleton and it's not quite a factory either, or is it? I am implementing (in another language) a object which does: 1. Prevents direct instantiation by virtue of a private constructor 2. The second object which is used to create the said oibject manages the instances to limit only one per class So I get the benefits of a singleton while still honoring inversion of control or DIP. Without the global introduced using a singleton. Cheers, Alex

    L 1 Reply Last reply
    0
    • A alex barylski

      You know that helper macro in MFC (pardon my ignorance but I haven't used MFC in probalby 6-7 years) that is used for creating object at runtime, used in Views, I think it's RUNTIME_CLASS or something??? What is the name of the closest pattern for that implementation, obviously it's not a singleton and it's not quite a factory either, or is it? I am implementing (in another language) a object which does: 1. Prevents direct instantiation by virtue of a private constructor 2. The second object which is used to create the said oibject manages the instances to limit only one per class So I get the benefits of a singleton while still honoring inversion of control or DIP. Without the global introduced using a singleton. Cheers, Alex

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      XanderXP wrote:

      What is the name of the closest pattern for that implementation, obviously it's not a singleton and it's not quite a factory either, or is it?

      I guess that it could be said that the MFC Doc/View architecture closely resembles the Model-View-Controller pattern[^].

      XanderXP wrote:

      I am implementing (in another language)

      Sounds interesting. What language are you working with? Best Wishes, -David Delaune

      A 1 Reply Last reply
      0
      • L Lost User

        XanderXP wrote:

        What is the name of the closest pattern for that implementation, obviously it's not a singleton and it's not quite a factory either, or is it?

        I guess that it could be said that the MFC Doc/View architecture closely resembles the Model-View-Controller pattern[^].

        XanderXP wrote:

        I am implementing (in another language)

        Sounds interesting. What language are you working with? Best Wishes, -David Delaune

        A Offline
        A Offline
        alex barylski
        wrote on last edited by
        #3

        Randor wrote:

        guess that it could be said that the MFC Doc/View architecture closely resembles the Model-View-Controller pattern

        It could be, but more formally I believe MFC and Doc/View are refered to as MVP, unfortunately neither pattern are what I am looking for. I think I may have to discover my own name as it's one part service locator and one part singleton but removed of functionality in both to meet very specific requirements.

        Randor wrote:

        Sounds interesting. What language are you working with?

        Only the best, most flexible language in the world. :P *cough* PHP *cough* Seriously though, while the language is responsible for some of the most naieve developers and most hackish projects, known to man, like any language if you follow best practices, patterns, etc. It's a real treat to work with. Cheers, Alex

        L 1 Reply Last reply
        0
        • A alex barylski

          Randor wrote:

          guess that it could be said that the MFC Doc/View architecture closely resembles the Model-View-Controller pattern

          It could be, but more formally I believe MFC and Doc/View are refered to as MVP, unfortunately neither pattern are what I am looking for. I think I may have to discover my own name as it's one part service locator and one part singleton but removed of functionality in both to meet very specific requirements.

          Randor wrote:

          Sounds interesting. What language are you working with?

          Only the best, most flexible language in the world. :P *cough* PHP *cough* Seriously though, while the language is responsible for some of the most naieve developers and most hackish projects, known to man, like any language if you follow best practices, patterns, etc. It's a real treat to work with. Cheers, Alex

          L Offline
          L Offline
          Lost User
          wrote on last edited by
          #4

          XanderXP wrote:

          *cough* PHP *cough*

          Heh, I remember the birth of PHP. I was not doing any Windows development in the mid 90's and was a Unix developer/sys admin. I haven't done any PHP development in over 10 years I would probably be lost in PHP5. The PHP language itself has come a long way. Good luck with your PHP project. Best Wishes, -David Delaune

          A 1 Reply Last reply
          0
          • L Lost User

            XanderXP wrote:

            *cough* PHP *cough*

            Heh, I remember the birth of PHP. I was not doing any Windows development in the mid 90's and was a Unix developer/sys admin. I haven't done any PHP development in over 10 years I would probably be lost in PHP5. The PHP language itself has come a long way. Good luck with your PHP project. Best Wishes, -David Delaune

            A Offline
            A Offline
            alex barylski
            wrote on last edited by
            #5

            Randor wrote:

            Heh, I remember the birth of PHP. I was not doing any Windows development in the mid 90's and was a Unix developer/sys admin. I haven't done any PHP development in over 10 years I would probably be lost in PHP5. The PHP language itself has come a long way.

            So you remember it's birth as a series of Perl scripts and being called "Personal Homepage"? :P I started at the time PHP 3 was released... Back then I was learning/tinkering in C and C++ in the 1990's, it was only when I started thinking I'd like to make a career out of software development that I looked for an easy enterance. Web site projects were plenty and didn't require a BSc. so I started learning JS, HTML and ASP. I hated ASP, looked for an open source solution and started with Perl which led me to PHP (thank god). It's annoying to develop in, because of the lack of any standard framework (at least a few hundred available -- with new ones popping up each week) unlike MFC, to provide your application with some structure. When fixing or working on existing applications, it can be like finding a needle in a haystack. One guys interpretaion of MVC and a front controller, actually turns out to be a extremely tightly coupled application bootstrap, front controller, routing, dispatching and more, in one monolithic class over 1000 lines. Lots of bad practice in PHP but there is a small community dedicated developers trying to change that by introducing patterns, OO best practices, architecture and more. Zend framework is a good start, with it's design issues and all. Cheers, Alex

            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