Search Unity

  1. Welcome to the Unity Forums! Please take the time to read our Code of Conduct to familiarize yourself with the forum rules and how to post constructively.
  2. Voting for the Unity Awards are OPEN! We’re looking to celebrate creators across games, industry, film, and many more categories. Cast your vote now for all categories
    Dismiss Notice
  3. Dismiss Notice

Design patterns in Game Development: religion or tool?

Discussion in 'General Discussion' started by Lurking-Ninja, Nov 23, 2018.

?

When you should use design patterns?

  1. All the time without exception

    5 vote(s)
    13.2%
  2. Depends on the project

    33 vote(s)
    86.8%
  1. Owen-Reynolds

    Owen-Reynolds

    Joined:
    Feb 15, 2012
    Posts:
    1,914
    [In response to Me: "I think you're imagining how you'd like it to work"]

    I don't think you know "Design Patterns" is a specific term. Maybe it's a translation problem. I think you're purposely writing about general software design. That's fine. Except when someone mentions something specific from Design Patterns, I don't think you don't know they are, and reply inappropriately.

    My point here is to prevent a future reader from getting the wrong impression - that they should delve into Design Pattern literature. There may be lots of useful insights in this thread. But, so far, NONE OF THEM ARE DESIGN PATTERNS.
     
  2. AndersMalmgren

    AndersMalmgren

    Joined:
    Aug 31, 2014
    Posts:
    5,358
    Design principles and patterns are a tool for software design. If you extract a part of a class to a new component you are doing composition over inheritance regardless of what you think about design principles :)
     
  3. angrypenguin

    angrypenguin

    Joined:
    Dec 29, 2011
    Posts:
    15,504
    Maybe there is a translation problem? I'm quite well aware of what a design pattern is. I'm also quite well aware that much of what's discussed in this thread is general design rather than patterns in particular.
     
  4. Owen-Reynolds

    Owen-Reynolds

    Joined:
    Feb 15, 2012
    Posts:
    1,914
    There's a 1994 book "Design Patterns: elements of reusable object-oriented software". That's the first use of the term, and for about 15 years the official definition of Design Pattern was the exact techniques in the book, using the exact names they gave them, with the exact awkward syntax. Java-coders embraced that book like a religion, later C# business coders. If one were to, quoting AndersM "extract a part of a class to a new component [...] doing composition over inheritance", they'd be asked to explain which of the 25 Design Patterns it was (none yet, but could be part of Bridge or Composite, I think).

    Language changes. Searching for "Design Patterns" will get you a few paragraphs about reusable high-level organization techniques. But mostly you'll find discussions about how to classify and use those exact tricks, like "is this code using Factory or Abstract Factory?" As human language, IMHO, Design Patterns 80% still means changing your program to fit better into categories from that book.
     
  5. Lurking-Ninja

    Lurking-Ninja

    Joined:
    Jan 20, 2015
    Posts:
    9,900
    Well, they call them "The Gang of Four", this was their hell of a drive-by shooting.
     
    Socrates likes this.