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. The Lounge
  3. Design Patterns

Design Patterns

Scheduled Pinned Locked Moved The Lounge
comdesignregexquestioncareer
44 Posts 27 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.
  • I Ian Shlasko

    Huh... So... In English, DI/IOC = "Choose interface implementations in config files" Yeah, I've done that before, without the buzzwords :)

    Proud to have finally moved to the A-Ark. Which one are you in?
    Author of the Guardians Saga (Sci-Fi/Fantasy novels)

    D Offline
    D Offline
    DaveAuld
    wrote on last edited by
    #19

    Don't ask me there is only one pattern I full understand. Drink Beer, Drink Spirits, Drink More Beer, Drink More Spririts........fall over.....go home. :)

    Dave Find Me On: Web|Facebook|Twitter|LinkedIn


    Folding Stats: Team CodeProject

    M 1 Reply Last reply
    0
    • I Ian Shlasko

      Huh... So... In English, DI/IOC = "Choose interface implementations in config files" Yeah, I've done that before, without the buzzwords :)

      Proud to have finally moved to the A-Ark. Which one are you in?
      Author of the Guardians Saga (Sci-Fi/Fantasy novels)

      P Offline
      P Offline
      PIEBALDconsult
      wrote on last edited by
      #20

      Ian Shlasko wrote:

      "Choose interface implementations in config files"

      Oh, that! Yeah, I do that. The first time was in a C program -- function pointers ;) .

      1 Reply Last reply
      0
      • A Andy Brummer

        So when I started my current job, one of the developers who was on his way out told me about their global variable pattern. The pattern was that all the names were prefixed with g_. :-\

        Curvature of the Mind now with 3D

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

        Finally, a pattern I can understand.

        1 Reply Last reply
        0
        • L lewax00

          Espen Harlinn wrote:

          if we don't use the same name, how can we expect people to understand what we are going on about?

          Reminds me of what I'm currently working on...our team refers to it as one thing, the guy who wrote it refers to it as another in his commits, and in the code it has an unrelated third name. Took a while to figure out WHERE it was, still trying to figure out how to make the necessary changes... :doh:

          E Offline
          E Offline
          Espen Harlinn
          wrote on last edited by
          #22

          Hmm, yes, I have a colleague who invariably names classes and methods based on how impressive he can make it sound - often using terms unrelated to the task at hand, terms that often has another "well known" meaning to most programmers.

          Espen Harlinn Principal Architect, Software - Goodtech Projects & Services AS My LinkedIn Profile

          1 Reply Last reply
          0
          • F Forogar

            Unless it's a meaningless name... On many occasions, usually during job interviews, I have been asked about some "named" technology and my answer has usually had to be "I've heard of it; tell me what it is and I'll tell you if I've used it". Often I find I have been using some pattern for a long time (in a nameless kind of way) and only when someone puts a name on it do I suddenly find myself feeling ignorant! The patterns I know are the "thingy" and the "other thingy" and the "singleton" (I've worked out roughly what that one was)! ;P ...by the way - I usually got the job!

            - Life in the fast lane is only fun if you live in a country with no speed limits. - Of all the things I have lost, it is my mind that I miss the most. - I vaguely remember having a good memory...

            E Offline
            E Offline
            Espen Harlinn
            wrote on last edited by
            #23

            Forogar wrote:

            I find I have been using some pattern for a long time (in a nameless kind of way) and only when someone puts a name on it do I suddenly find myself feeling ignorant!

            Most patterns where not invented by the persons who coined them - that you've come up with a few of them on your own, shows the value of those patterns - and that you come fully equipped with a brain :)

            Espen Harlinn Principal Architect, Software - Goodtech Projects & Services AS My LinkedIn Profile

            1 Reply Last reply
            0
            • L lewax00

              I'm still trying to figure out how/if that's any different than MVC. I like MVC for web applications...and that's about it.

              K Offline
              K Offline
              Keith Barrow
              wrote on last edited by
              #24

              It is, but they are very close to eachother, arguably M-V-VM is a specialisation of MVC: Common To Both: Model: Your everyday garden variety OM View: The GUI that displays to the user Depends Who You Ask: Controller: Inherently part of MVC, but may or may not be part of MVVM depending who you ask. The layer that orchestrates the work, deciding which view is displayed gets the OM to do stuff in repsone to GUI/other events etc. The MVVM Difference View Model: An intermediary layer between the view and the model. Typically the VM is bound to the view, reacting to to GUI events or providing UI-specific values based on information in the state. I can see why this is confusing though, there are a lot of articles on the Tinterweb with varying degrees of clarity and accuracy. To see a MVVM work well you should try it in WPF or Silverlight. It is quite possible to do without the controller. The chances are, if you are writing and MVC3 application you will have ViewModels where there is stuff you don't want in the OM but need to display in the view. To muddy the issue, I have seen an MVVM system with a controller described as MVCVM where people don't agree that this is really just MVVM

              Sort of a cross between Lawrence of Arabia and Dilbert.[^]
              -Or-
              A Dead ringer for Kate Winslett[^]

              L 1 Reply Last reply
              0
              • R R Giskard Reventlov

                Sometimes, when I read pattern definitions, I can imagine the author/s sitting there going how can we make this reasonably simple idea that's been around for years and years in various forms sound really, really smart and, at the same time, give it a really funky name like 'The Strategy Pattern' or 'The Chain of Responsibility Pattern'? Or how can we make this pile of nonsensical verbiage sound as if it actually does something meaningful? Don't get me wrong; I rather like patterns or, at least, some of them. I just find it amusing that some basic ideas suddenly get popular because they get a groovy makeover.

                "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me

                K Offline
                K Offline
                Keith Barrow
                wrote on last edited by
                #25

                I'm surprised we don't hear this viewpoint more often, it is getting ridiculous and I suspect a backlash may start soon. The original GoF idea was good: find common solutions to common problems, describe them and give them a name so we all have a shorthand to know what we are talking about. Fine in theory, until it becomes the thing-de-jour and every Tom, Dick and Henrietta decides to create their own "patterns" and bang on about it. Worse, people throw the name of a pattern around in a way to suggest that because there is a pattern it is applicable and no further discussion is available. Hey I discovered a new pattern, the Unary Increment Pattern: i++;

                Sort of a cross between Lawrence of Arabia and Dilbert.[^]
                -Or-
                A Dead ringer for Kate Winslett[^]

                E 1 Reply Last reply
                0
                • K Keith Barrow

                  It is, but they are very close to eachother, arguably M-V-VM is a specialisation of MVC: Common To Both: Model: Your everyday garden variety OM View: The GUI that displays to the user Depends Who You Ask: Controller: Inherently part of MVC, but may or may not be part of MVVM depending who you ask. The layer that orchestrates the work, deciding which view is displayed gets the OM to do stuff in repsone to GUI/other events etc. The MVVM Difference View Model: An intermediary layer between the view and the model. Typically the VM is bound to the view, reacting to to GUI events or providing UI-specific values based on information in the state. I can see why this is confusing though, there are a lot of articles on the Tinterweb with varying degrees of clarity and accuracy. To see a MVVM work well you should try it in WPF or Silverlight. It is quite possible to do without the controller. The chances are, if you are writing and MVC3 application you will have ViewModels where there is stuff you don't want in the OM but need to display in the view. To muddy the issue, I have seen an MVVM system with a controller described as MVCVM where people don't agree that this is really just MVVM

                  Sort of a cross between Lawrence of Arabia and Dilbert.[^]
                  -Or-
                  A Dead ringer for Kate Winslett[^]

                  L Offline
                  L Offline
                  lewax00
                  wrote on last edited by
                  #26

                  Keith Barrow wrote:

                  MVVM system with a controller described as MVCVM where people don't agree that this is really just MVVM

                  Now it's just starting to look like poorly formed roman numerals... :laugh:

                  1 Reply Last reply
                  0
                  • R R Giskard Reventlov

                    Sometimes, when I read pattern definitions, I can imagine the author/s sitting there going how can we make this reasonably simple idea that's been around for years and years in various forms sound really, really smart and, at the same time, give it a really funky name like 'The Strategy Pattern' or 'The Chain of Responsibility Pattern'? Or how can we make this pile of nonsensical verbiage sound as if it actually does something meaningful? Don't get me wrong; I rather like patterns or, at least, some of them. I just find it amusing that some basic ideas suddenly get popular because they get a groovy makeover.

                    "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me

                    T Offline
                    T Offline
                    Tom Delany
                    wrote on last edited by
                    #27

                    I work with another developer who has invented his own code-formatting pattern that I have decided to name the "Horribly Ugly Really Lame" pattern (HURL for short), because that's what it makes me want to do every time I look at his C/C++ source code. X|

                    WE ARE DYSLEXIC OF BORG. Refutance is systile. Your a$$ will be laminated. There are 10 kinds of people in the world: People who know binary and people who don't.

                    1 Reply Last reply
                    0
                    • K Keith Barrow

                      I'm surprised we don't hear this viewpoint more often, it is getting ridiculous and I suspect a backlash may start soon. The original GoF idea was good: find common solutions to common problems, describe them and give them a name so we all have a shorthand to know what we are talking about. Fine in theory, until it becomes the thing-de-jour and every Tom, Dick and Henrietta decides to create their own "patterns" and bang on about it. Worse, people throw the name of a pattern around in a way to suggest that because there is a pattern it is applicable and no further discussion is available. Hey I discovered a new pattern, the Unary Increment Pattern: i++;

                      Sort of a cross between Lawrence of Arabia and Dilbert.[^]
                      -Or-
                      A Dead ringer for Kate Winslett[^]

                      E Offline
                      E Offline
                      Espen Harlinn
                      wrote on last edited by
                      #28

                      Well said - another problem that I tend to see a lot of, is developers that overcomplicates stuff because they feel they have to use a pattern, turning even the simplest things into major development efforts.

                      Espen Harlinn Principal Architect, Software - Goodtech Projects & Services AS My LinkedIn Profile

                      M 1 Reply Last reply
                      0
                      • I Ian Shlasko

                        Huh... So... In English, DI/IOC = "Choose interface implementations in config files" Yeah, I've done that before, without the buzzwords :)

                        Proud to have finally moved to the A-Ark. Which one are you in?
                        Author of the Guardians Saga (Sci-Fi/Fantasy novels)

                        M Offline
                        M Offline
                        Mel Padden
                        wrote on last edited by
                        #29

                        Damn right. Except that in interviews where they want someone who is an "IOC Expert" they want you to fart on about it until you're blue in the face. :zzz:

                        I too dabbled in pacifism once.

                        J 1 Reply Last reply
                        0
                        • R R Giskard Reventlov

                          Sometimes, when I read pattern definitions, I can imagine the author/s sitting there going how can we make this reasonably simple idea that's been around for years and years in various forms sound really, really smart and, at the same time, give it a really funky name like 'The Strategy Pattern' or 'The Chain of Responsibility Pattern'? Or how can we make this pile of nonsensical verbiage sound as if it actually does something meaningful? Don't get me wrong; I rather like patterns or, at least, some of them. I just find it amusing that some basic ideas suddenly get popular because they get a groovy makeover.

                          "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me

                          B Offline
                          B Offline
                          Brady Kelly
                          wrote on last edited by
                          #30

                          You are right, but I must add that having a good practice, already widely used, codified in a common but regular language, makes it much easier to communicate on aspects, and use of, that practice.

                          1 Reply Last reply
                          0
                          • R R Giskard Reventlov

                            Sometimes, when I read pattern definitions, I can imagine the author/s sitting there going how can we make this reasonably simple idea that's been around for years and years in various forms sound really, really smart and, at the same time, give it a really funky name like 'The Strategy Pattern' or 'The Chain of Responsibility Pattern'? Or how can we make this pile of nonsensical verbiage sound as if it actually does something meaningful? Don't get me wrong; I rather like patterns or, at least, some of them. I just find it amusing that some basic ideas suddenly get popular because they get a groovy makeover.

                            "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me

                            F Offline
                            F Offline
                            Fran Porretto
                            wrote on last edited by
                            #31

                            If memory serves, it was the late Grace Hopper who said:

                            "We never do anything new in this field; we just rename the old stuff."

                            It does make for a lot of new books every two or three years, though.

                            (This message is programming you in ways you cannot detect. Be afraid.)

                            1 Reply Last reply
                            0
                            • R R Giskard Reventlov

                              Sometimes, when I read pattern definitions, I can imagine the author/s sitting there going how can we make this reasonably simple idea that's been around for years and years in various forms sound really, really smart and, at the same time, give it a really funky name like 'The Strategy Pattern' or 'The Chain of Responsibility Pattern'? Or how can we make this pile of nonsensical verbiage sound as if it actually does something meaningful? Don't get me wrong; I rather like patterns or, at least, some of them. I just find it amusing that some basic ideas suddenly get popular because they get a groovy makeover.

                              "If you think it's expensive to hire a professional to do the job, wait until you hire an amateur." Red Adair. nils illegitimus carborundum me, me, me

                              S Offline
                              S Offline
                              Steve Weinrich
                              wrote on last edited by
                              #32

                              I never understood the basis for the names of some of the patterns. Their names should absolutely reflect the function of the pattern so normal coders will have a chance at hitting references to it in a web search or in discussion. Because otherwise, we're just hiding the patterns from the very folks that will benefit the most from them!

                              1 Reply Last reply
                              0
                              • L lewax00

                                Now that I've managed to get some idea of what it is (and now have a name for the exact thing I hate most about the code I have to work with), I can think of good applications for DI (but really, isn't that covered by interfaces/abstract classes?), but IoC just makes things difficult to maintain :doh: Where is this class? Oh...I don't get to know because it's hidden by the IoC container...awesome...

                                M Offline
                                M Offline
                                Mike Marynowski
                                wrote on last edited by
                                #33

                                +1, agreed. I find IoC to be taking the whole abstraction thing a little too far. I guess the idea is to take away dependencies for testing because you can mock everything, but I don't really see the point - you have to test everything anyway...

                                1 Reply Last reply
                                0
                                • L lewax00

                                  mark merrens wrote:

                                  how can we make this pile of nonsensical verbiage sound as if it actually does something meaningful?

                                  I'm still trying to figure out IoC and dependency injection...can't seem to find any examples that a) make sense to someone with a short attention span b) provide a realistic example of why I should care but there seems to be a big fuss about them, so I must be missing something...

                                  B Offline
                                  B Offline
                                  boarderstu
                                  wrote on last edited by
                                  #34

                                  Isn't DI/IoC just another way of loose coupling?

                                  1 Reply Last reply
                                  0
                                  • E Espen Harlinn

                                    Well said - another problem that I tend to see a lot of, is developers that overcomplicates stuff because they feel they have to use a pattern, turning even the simplest things into major development efforts.

                                    Espen Harlinn Principal Architect, Software - Goodtech Projects & Services AS My LinkedIn Profile

                                    M Offline
                                    M Offline
                                    Mike Marynowski
                                    wrote on last edited by
                                    #35

                                    I think that's the biggest problem with all this pattern driven design. People just need to think about the best way to solve a problem and do it instead of trying to fit the problem into one of the pre-existing patterns.

                                    E 1 Reply Last reply
                                    0
                                    • M Mel Padden

                                      Damn right. Except that in interviews where they want someone who is an "IOC Expert" they want you to fart on about it until you're blue in the face. :zzz:

                                      I too dabbled in pacifism once.

                                      J Offline
                                      J Offline
                                      jsc42
                                      wrote on last edited by
                                      #36

                                      and all this time, I've thought that IOC was the International Olympics Committee.

                                      1 Reply Last reply
                                      0
                                      • M Mike Marynowski

                                        I think that's the biggest problem with all this pattern driven design. People just need to think about the best way to solve a problem and do it instead of trying to fit the problem into one of the pre-existing patterns.

                                        E Offline
                                        E Offline
                                        Espen Harlinn
                                        wrote on last edited by
                                        #37

                                        I think I should add that when I take on larger projects, I sometimes reread books like Pattern-Oriented Software Architecture: A Pattern Language for Distributed Computing[^]. It kind of helps me to put "ze little grey cells" into the right mood.

                                        Espen Harlinn Principal Architect, Software - Goodtech Projects & Services AS My LinkedIn Profile

                                        1 Reply Last reply
                                        0
                                        • F Forogar

                                          Unless it's a meaningless name... On many occasions, usually during job interviews, I have been asked about some "named" technology and my answer has usually had to be "I've heard of it; tell me what it is and I'll tell you if I've used it". Often I find I have been using some pattern for a long time (in a nameless kind of way) and only when someone puts a name on it do I suddenly find myself feeling ignorant! The patterns I know are the "thingy" and the "other thingy" and the "singleton" (I've worked out roughly what that one was)! ;P ...by the way - I usually got the job!

                                          - Life in the fast lane is only fun if you live in a country with no speed limits. - Of all the things I have lost, it is my mind that I miss the most. - I vaguely remember having a good memory...

                                          J Offline
                                          J Offline
                                          jsc42
                                          wrote on last edited by
                                          #38

                                          I invented a lovely pattern for organising data into linear lists with mappings between them and used it successfully in several projects. Then someone called Ted Codd came along and wowed the world with relational databases and 3rd Normal Form. Not materially different in any way from what I was doing. Another scheme that I invented was a way of referencing devices anywhere in the world by a hierarchical numbering systems (based on octets). I could not resolve the problem of spoofing (how to authenticate that a device was who it said it was; and not some other device masquerading as the intended device), so I gave up. Sometime later, someone inflicted IPv4 on the world. That was non-hierarchical (you have to put the full address even for local devices), based on octets, and has just ignored the spoofing problem. Inferior to what I had designed.

                                          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