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. To Integrate or not to Integrate

To Integrate or not to Integrate

Scheduled Pinned Locked Moved The Lounge
sysadmincollaborationxmlquestion
4 Posts 4 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.
  • 4 Offline
    4 Offline
    4277480
    wrote on last edited by
    #1

    We are working on a project to simulate soccer players. The template provided dictated that the main class instantiates the brain of a player (we also pass parameters to the main class). In order to make our players as diverse as possible we developed two approaches in parallel. The first being an XML state machine (done by yours truly) and a Bayesian decision network done by "x". The time came where we had to integrate both logics in our team. "x" wanted to rewrite the brain class to incorporate both logics but I was against that because they are totally different! and bashed him for his OOD skills So he asked me then HTF Mr. genius will you do it? (think about it or skip to answer below) So I told him the requirement dictated that the brain be instantiated from the main class right? yes, But there was no constraint on how many brains we use correct? yes, therefore, we simply keep both logics and pass in a parameter to the main class that switch instantiates whichever logic we specify! Simple eh, yup :)

    P M M 3 Replies Last reply
    0
    • 4 4277480

      We are working on a project to simulate soccer players. The template provided dictated that the main class instantiates the brain of a player (we also pass parameters to the main class). In order to make our players as diverse as possible we developed two approaches in parallel. The first being an XML state machine (done by yours truly) and a Bayesian decision network done by "x". The time came where we had to integrate both logics in our team. "x" wanted to rewrite the brain class to incorporate both logics but I was against that because they are totally different! and bashed him for his OOD skills So he asked me then HTF Mr. genius will you do it? (think about it or skip to answer below) So I told him the requirement dictated that the brain be instantiated from the main class right? yes, But there was no constraint on how many brains we use correct? yes, therefore, we simply keep both logics and pass in a parameter to the main class that switch instantiates whichever logic we specify! Simple eh, yup :)

      P Offline
      P Offline
      Pete OHanlon
      wrote on last edited by
      #2

      So, you've used a bad design practice to justify a dodgy decision. A better approach would have been to use an interface to define the contract the brain follows, and then use something like Dependency Injection to pick an appropriate implementation. In my experience, most football players don't show evidence of using one brain, let alone two.

      I have CDO, it's OCD with the letters in the right order; just as they ruddy well should be

      Forgive your enemies - it messes with their heads

      My blog | My articles | MoXAML PowerToys | Onyx

      1 Reply Last reply
      0
      • 4 4277480

        We are working on a project to simulate soccer players. The template provided dictated that the main class instantiates the brain of a player (we also pass parameters to the main class). In order to make our players as diverse as possible we developed two approaches in parallel. The first being an XML state machine (done by yours truly) and a Bayesian decision network done by "x". The time came where we had to integrate both logics in our team. "x" wanted to rewrite the brain class to incorporate both logics but I was against that because they are totally different! and bashed him for his OOD skills So he asked me then HTF Mr. genius will you do it? (think about it or skip to answer below) So I told him the requirement dictated that the brain be instantiated from the main class right? yes, But there was no constraint on how many brains we use correct? yes, therefore, we simply keep both logics and pass in a parameter to the main class that switch instantiates whichever logic we specify! Simple eh, yup :)

        M Offline
        M Offline
        Marc Clifton
        wrote on last edited by
        #3

        Sounds like a disconnect between the left and right brain. ;) Marc

        1 Reply Last reply
        0
        • 4 4277480

          We are working on a project to simulate soccer players. The template provided dictated that the main class instantiates the brain of a player (we also pass parameters to the main class). In order to make our players as diverse as possible we developed two approaches in parallel. The first being an XML state machine (done by yours truly) and a Bayesian decision network done by "x". The time came where we had to integrate both logics in our team. "x" wanted to rewrite the brain class to incorporate both logics but I was against that because they are totally different! and bashed him for his OOD skills So he asked me then HTF Mr. genius will you do it? (think about it or skip to answer below) So I told him the requirement dictated that the brain be instantiated from the main class right? yes, But there was no constraint on how many brains we use correct? yes, therefore, we simply keep both logics and pass in a parameter to the main class that switch instantiates whichever logic we specify! Simple eh, yup :)

          M Offline
          M Offline
          Mark_Wallace
          wrote on last edited by
          #4

          Scrap the whole thing, and re-architect. Footballers with brains, indeed. You might as well design a motorbike sim with open hearth, chimney, and roof classes.

          I wanna be a eunuchs developer! Pass me a bread knife!

          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