Skip to main content
Filter by
Sorted by
Tagged with
3687 votes
40 answers
1.3m views

There have been several questions already posted with specific questions about dependency injection, such as when to use it and what frameworks are there for it. However, What is dependency injection ...
AR.'s user avatar
  • 40.4k
2346 votes
40 answers
741k views

Inversion of Control (IoC) can be quite confusing when it is first encountered. What is it? Which problem does it solve? When is it appropriate to use and when not?
Mike Minutillo's user avatar
2096 votes
41 answers
697k views

What real (i.e. practical) difference exists between a static class and a singleton pattern? Both can be invoked without instantiation, both provide only one "Instance" and neither of them is thread-...
Jorge Córdoba's user avatar
1487 votes
12 answers
334k views

A long time ago I have read an article (I believe a blog entry) which put me on the "right" track on naming objects: Be very very scrupulous about naming things in your program. For example if my ...
920 votes
24 answers
1.0m views

Recently I've bumped into a realization/implementation of the Singleton design pattern for C++. It has looked like this (I have adopted it from the real-life example): // a lot of methods are omitted ...
Artem Barger's user avatar
  • 41.3k
845 votes
27 answers
413k views

What is the difference between the Builder design pattern and the Factory design pattern? Which one is more advantageous and why ? How do I represent my findings as a graph if I want to test and ...
Penguen's user avatar
  • 17.4k
672 votes
7 answers
570k views

I am learning GoF Java Design Patterns and I want to see some real life examples of them. What are some good examples of these Design Patterns in Java's core libraries?
621 votes
11 answers
218k views

I'm trying to get my head around how to properly use the repository pattern. The central concept of an Aggregate Root keeps coming up. When searching both the web and Stack Overflow for help with what ...
Dinah's user avatar
  • 54.3k
575 votes
31 answers
234k views

Most of the examples quoted for usage of Dependency Injection, we can solve using the factory pattern as well. Looks like when it comes to usage/design the difference between dependency injection and ...
571 votes
28 answers
52k views

As JavaScript frameworks like jQuery make client side web applications richer and more functional, I've started to notice one problem... How in the world do you keep this organized? Put all your ...
hugoware's user avatar
  • 36.4k
527 votes
19 answers
276k views

Factory and Abstract Factory are both creational patterns. What is the difference in case of intent and application between these two Patterns?
user366312's user avatar
  • 17.5k
517 votes
21 answers
258k views

Is it possible to implement the model–view–controller pattern in Java for Android? Or is it already implemented through Activities? Or is there a better way to implement the MVC pattern for Android?
Mohit Deshpande's user avatar
490 votes
48 answers
403k views

What is the simplest/cleanest way to implement the singleton pattern in JavaScript?
Jakub Arnold's user avatar
  • 87.5k
441 votes
17 answers
174k views

In Java IoC / DI is a very common practice which is extensively used in web applications, nearly all available frameworks and Java EE. On the other hand, there are also lots of big Python web ...
tux21b's user avatar
  • 95.9k
379 votes
10 answers
144k views

Recalling this post enumerating several problems of using singletons and having seen several examples of Android applications using singleton pattern, I wonder if it's a good idea to use Singletons ...
Martín Schonaker's user avatar
368 votes
5 answers
118k views

I am designing a simple web-based application. I am new to this web-based domain.I needed your advice regarding the design patterns like how responsibility should be distributed among Servlets, ...
mawia's user avatar
  • 9,417
351 votes
22 answers
192k views

I have read around 4-5 books on design patterns, but still I don't feel I have come closer to intermediate level in design patterns? How should I go studying design patterns? Is there any good ...
anand's user avatar
  • 11.4k
349 votes
20 answers
130k views

I keep seeing references to the visitor pattern in blogs but I've got to admit, I just don't get it. I read the wikipedia article for the pattern and I understand its mechanics but I'm still confused ...
George Mauer's user avatar
323 votes
24 answers
224k views

Edit: From another question I provided an answer that has links to a lot of questions/answers about singletons: More info about singletons here: So I have read the thread Singletons: good design ...
297 votes
6 answers
134k views

Design patterns are usually related to object oriented design. Are there design patterns for creating and programming relational databases? Many problems surely must have reusable solutions. Examples ...
288 votes
12 answers
149k views

Coming from a C and C++ background, I found judicious use of typedef to be incredibly helpful. Do you know of a way to achieve similar functionality in Java, whether that be a Java mechanism, pattern,...
bn.'s user avatar
  • 7,969
284 votes
16 answers
130k views

I am studying patterns and anti-patterns. I have a clear idea about patterns, but I don't get anti-patterns. Definitions from the web and Wikipedia confuse me a lot. Can anybody explain to me in ...
g.revolution's user avatar
  • 12.3k
279 votes
27 answers
84k views

Is it a good or bad idea to make setters in java return "this"? public Employee setName(String name){ this.name = name; return this; } This pattern can be useful because then you can chain ...
Ken Liu's user avatar
  • 23k
253 votes
25 answers
134k views

In the MVVM pattern for WPF, handling dialogs is one of the more complex operations. As your view model does not know anything about the view, dialog communication can be interesting. I can expose ...
Ray Booysen's user avatar
  • 30.2k
245 votes
6 answers
187k views

If we search Google using the phrase "differences between MVC, MVP & MVVM design pattern" then we may get a few URL's which discuss the difference between MVC MVP & MVVM design ...
Thomas's user avatar
  • 34.3k

1
2 3 4 5
644