views:

238

answers:

4

After spending many years of analysis, design and programming in different
domains and architectures, you have maybe come across a "pattern" or good
practice that haven't been published as a pattern (analysis, design or architecture).
Although you have done it many times before, it has no name.

Interested in patterns from the SO-community.

+1  A: 

Not really a new pattern, but I have often used a combination of the factory and strategy pattern. This prevents the factory from having switch statements and you can configure your factory with new "factory strategies". I'm not sure if this pattern has a name. If anyone can tell me, I would appreciate that.

I blogged about this a while ago: http://www.herrodius.com/blog/136

Christophe Herreman
@Christophe Herremar: Thanks read your blog. Not sure about the name of your pattern, though +1
Kb
+3  A: 

The ones I once thought were of my own i.e. 'I invented them', turned out to be 'invented' 20 years ago. I can't count how many times I realized that I was using an already well-known design pattern without knowing it.

Those are the result of many years of trying to resolve the same problems. I guess unless someone 'finds' a new problem domain you aren't likely to see a new pattern.

Maybe in the future, new programming paradigms or technologies will help uncover new ways of resolving the same old problems.

Trap
@Trap: Yes I agree. Many times the projects have refactored into well-known patterns
Kb
"Those are the result of many years of trying to resolve the same problems." As I understand it, that's basically the definition and point of "software design patterns".
Dave Sherohman
+1  A: 

I think just about everything has been invented more than once, but two patterns that I use all the time but don't see others using as much as I think they should do are:

  • Uncopyable object - most objects in the problem domain (examples: BankAccount, Person, Transaction) should not be copyable, unlike objects in the implementation domain (examples: string, array, integer). I therefore use language features to make such business domain objects uncopyable.

  • Owning object - an object such as a BankAccount owns its Transactions. When the owning object is destroyed, it manages the destruction of these owned objects. This pattern pretty much does away with the need to use smart pointers.

anon
@Neil Butterworth: Thanks +1
Kb
+1  A: 

I haven't come up with any new patterns myself but the best way to spot a new pattern is to know all the existing ones. This is one of my favorite design pattern websites. 101 Design Patterns. In particular, pay attention to the anti-patterns.

Arnold Spence