Top "Design-patterns" questions

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

Best ruby idiom for "nil or zero"

I am looking for a concise way to check a value to see if it is nil or zero. Currently …

ruby design-patterns idioms null
Why would one use the Publish/Subscribe pattern (in JS/jQuery)?

So, a colleague introduced me to the publish/subscribe pattern (in JS/jQuery), but I'm having a hard time getting …

javascript jquery design-patterns publish-subscribe
Subclassing a Java Builder class

Give this Dr Dobbs article, and the Builder Pattern in particular, how do we handle the case of subclassing a …

java design-patterns
Is it bad practice to make a setter return "this"?

Is it a good or bad idea to make setters in java return "this"? public Employee setName(String name){ this.…

java design-patterns api oop
Abstract factory pattern

Good example for Abstract factory pattern in C#? What are the advantages of the Abstract factory pattern in C#? How …

design-patterns c#-4.0 architecture abstract-factory
Difference between the Facade, Proxy, Adapter and Decorator design patterns?

What is the difference between the Facade, Proxy, Adapter, and Decorator design patterns? I have never read a clear explanation, …

design-patterns proxy adapter decorator facade
Design Patterns: Abstract Factory vs Factory Method

Note: Questions are at the end of the post. I have read the other stackoverflow threads regarding Abstract Factory vs …

design-patterns language-agnostic uml factory-method abstract-factory
Why create "Implicitly Unwrapped Optionals", since that implies you know there's a value?

Why would you create a "Implicitly Unwrapped Optional" vs creating just a regular variable or constant? If you know that …

swift design-patterns optional
How to implement Builder pattern in Kotlin?

Hi I am a newbie in the Kotlin world. I like what I see so far and started to think …

design-patterns kotlin
Utility classes are evil?

I saw this thread If a "Utilities" class is evil, where do I put my generic code? and thought why …

design-patterns software-design