Top "Design-patterns" questions

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

Where to place AutoMapper.CreateMaps?

I'm using AutoMapper in an ASP.NET MVC application. I was told that I should move the AutoMapper.CreateMap elsewhere …

asp.net-mvc design-patterns configuration automapper
Design Patterns: Factory vs Factory method vs Abstract Factory

I was reading design patterns from a website There I read about Factory, Factory method and Abstract factory but they …

java design-patterns language-agnostic factory factory-method
python design patterns

I am looking for any resources that gives examples of Best Practices, Design patterns and the SOLID principles using Python.

python design-patterns
UI Design Pattern for Windows Forms (like MVVM for WPF)

MVVM is most commonly used with WPF because it is perfectly suited for it. But what about Windows Forms? Is …

winforms design-patterns
Abstract class vs Interface in Java

I was asked a question, I wanted to get my answer reviewed here. Q: In which scenario it is more …

java design-patterns interface abstract-class
Understand the "Decorator Pattern" with a real world example

I was studying the Decorator Pattern as documented in GOF. Please, help me understand the Decorator Pattern. Could someone give …

decorator design-patterns
Instantiate an object with a runtime-determined type

I'm in a situation where I'd like to instantiate an object of a type that will be determined at runtime. …

c# .net design-patterns runtime
When do you use the Bridge Pattern? How is it different from Adapter pattern?

Has anyone ever used the Bridge Pattern in a real world application? If so, how did you use it? Is …

design-patterns adapter bridge
C++ code for state machine

This was an interview question to be coded in C++: Write code for a vending machine: Start with a simple …

c++ design-patterns switch-statement state-machine idioms
What are the downsides to using Dependency Injection?

I'm trying to introduce DI as a pattern here at work and one of our lead developers would like to …

design-patterns dependency-injection