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.
  • 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...

    K Offline
    K Offline
    Karl Sanford
    wrote on last edited by
    #12

    As someone who has to use DI/IoC, I can tell you that there is no example for (b) :^)

    Be The Noise

    L 1 Reply Last reply
    0
    • Sander RosselS Sander Rossel

      Indeed, today I wanted to talk about that thing which does that thing for the other thing... People looked puzzled, I think I'll write a book about those things.

      It's an OO world.

      public class Naerling : Lazy<Person>{
      public void DoWork(){ throw new NotImplementedException(); }
      }

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

      Naerling wrote:

      I think I'll write a book about those things that stuff

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

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

      L 1 Reply Last reply
      0
      • D DaveAuld

        I think Sacha Barber wrote articles on both those subject........DI/IOCs[^]

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


        Folding Stats: Team CodeProject

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

        Ah, that's the first article on the subject I've fully understood, thanks :thumbsup: And now I realize I've been using DI in my own code, and interacting with IoC code for a while now...

        1 Reply Last reply
        0
        • E Espen Harlinn

          Giving stuff a name kind of helps when you want to talk about it.

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

          F Offline
          F Offline
          Forogar
          wrote on last edited by
          #15

          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 J 2 Replies Last reply
          0
          • E Espen Harlinn

            Naerling wrote:

            I think I'll write a book about those things that stuff

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

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

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

            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 1 Reply Last reply
            0
            • K Karl Sanford

              As someone who has to use DI/IoC, I can tell you that there is no example for (b) :^)

              Be The Noise

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

              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 1 Reply Last reply
              0
              • D DaveAuld

                I think Sacha Barber wrote articles on both those subject........DI/IOCs[^]

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


                Folding Stats: Team CodeProject

                I Offline
                I Offline
                Ian Shlasko
                wrote on last edited by
                #18

                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 P M 3 Replies 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)

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