9
\$\begingroup\$

Is there a correct usage for ? If so, can someone clarify it to me? Every time I see the tag, I'm left asking, "why is this a tag?"

Here's the snippet:

A design pattern is a general reusable solution to a commonly occurring problem in software design.

And here's the full Wiki entry:

A design pattern is a description or template that helps solve a reoccurring problem, which can be used in many different situations.

It is common to classify design patterns into the following categories:

  • Creational design patterns deal with object creation mechanisms, trying to create objects in a manner suitable to the situation. The basic form of object creation could result in design problems or added complexity to the design. Creational design patterns solve this problem by somehow controlling object creation.
  • Structural design patterns ease the design by identifying a simple way to realize relationships between entities.
  • Behavioral design patterns identify common communication patterns between objects and realize these patterns. By doing so, these patterns increase flexibility in carrying out this communication.
  • Concurrency patterns deal with the multi-threaded programming paradigm.

Related to design patterns, are architectural patterns. These are often concepts which solve and delineate some essential cohesive elements of a software architecture.

Wikipedia Article for Design Patterns

'Before' and 'After' refactoring examples

That's all well and good. I'm just not sure how relevant or useful the tag is to Code Review.

Reviewing design is a bit of a gray area in terms of whether or not the question is on-topic. However, reviewing whether or not a particular piece of code conforms to a particular, well-known design pattern (such as ) should be a perfectly on topic question. But if an asker wants a review of their code for compliance to a particular design pattern, why do we need the tag when we can use the specific design pattern as the tag?

So, is a meta tag? Does the tag add anything useful to questions that have the tag? Is anyone searching specifically for questions tagged ?

\$\endgroup\$
1
  • 3
    \$\begingroup\$ Regardless, we should also check the questions and make sure there aren't any about plain design review. Some users seemed to have used this tag to get around the absence of design. \$\endgroup\$
    – Jamal Mod
    Commented Jun 27, 2015 at 19:21

2 Answers 2

10
\$\begingroup\$

Consider the tag. It's some kind of a "general-purpose parent" in a "family" of tags that includes , and other common games people implement for fun.

When there's a specific tag for a game, we use it. Otherwise, is good enough, and at one point there's enough posts to warrant creating a tag for it.


There are a number of design patterns, and not all of them have a dedicated tag. People implement design patterns for learning purposes, or as part of a complex system that they put up for review, be it with , , , , and patterns. Do we need a tag for each and every single design pattern out there? Where's the tag?

I think the tag describes what's in the post and is useful to some degree, despite being pretty general. Seeing it used in conjunction with specific pattern tags though, doesn't look right.

...Which begs the question: should be a "master" tag?

\$\endgroup\$
2
  • 2
    \$\begingroup\$ I'm thinking we should review which tags exists, add ones that merit creation, and update the wiki. \$\endgroup\$
    – RubberDuck
    Commented Jun 27, 2015 at 17:17
  • 1
    \$\begingroup\$ For observer, I usually use callback. \$\endgroup\$
    – 200_success Mod
    Commented Jun 27, 2015 at 19:51
9
\$\begingroup\$

I contend that it is a useful tag. I use it whenever I've implemented a pattern to the best of my knowledge and ability, and would like to know if I implemented that design correctly. (Assuming a more specific tag doesn't exist, like .)

This is not a gray area at all. Questions using this tag should be asking if they've correctly implemented design pattern X. Asking if you've done this is on topic.

However, the tag is not appropriate (IMO) for questions asking what design pattern should be used to clean up the smell. That question should be stated in the question itself. Admittedly, not all such questions are on topic, but many are. Regardless, the tag doesn't apply in these cases, so it has no bearing on the usefulness of .

I think if anything needs to be done about the tag, we should look for common patterns that don't have an existing tag and see if they merit one.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .