Top "Design-patterns" questions

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

Singleton pattern in nodejs - is it needed?

I recently came across this article on how to write a singleton in Node.js. I know the documentation of …

javascript node.js design-patterns singleton
Why do we need Abstract factory design pattern?

Most of the definition says: An abstract factory provides an interface for creating families of related objects without specifying their …

design-patterns abstract-factory
Implementing Comments and Likes in database

I'm a software developer. I love to code, but I hate databases... Currently, I'm creating a website on which a …

mysql database design-patterns database-design
What does a diamond sign signify in UML class diagrams?

Consider the below two diagrams. The top one contains a plain arrow at the right end, and the bottom one …

design-patterns uml class-diagram
Spring AOP vs AspectJ

I am under the impression that Spring AOP is best used for application specific tasks such as security, logging, transactions, …

java spring design-patterns aspectj spring-aop
Real World Example of the Strategy Pattern

I've been reading about the OCP principal and how to use the strategy pattern to accomplish this. I was going …

java c# design-patterns strategy-pattern
How do the Proxy, Decorator, Adapter, and Bridge Patterns differ?

I was looking at the Proxy Pattern, and to me it seems an awful lot like the Decorator, Adapter, and …

design-patterns decorator bridge proxy-pattern
Replacing nested if statements

This is related to a chapter from beautiful code. And in that chapter I read about the nested ifs. The …

algorithm design-patterns nested
What is the method MemberwiseClone() doing?

I am confused with this code below, Developer devCopy = (Developer)dev.Clone(); Clone method of Developer class just creating a …

c# design-patterns prototype clone
What is the difference between Strategy design pattern and State design pattern?

What are the differences between the Strategy design pattern and the State design pattern? I was going through quite a …

design-patterns strategy-pattern state-pattern