Skip to main content
Filter by
Sorted by
Tagged with
102 votes
6 answers
54k views

Derik Whitaker posted an article a couple of days ago that hit a point that I've been curious about for some time: should business logic exist in controllers? So far all the ASP.NET MVC demos I've ...
Kevin Pang's user avatar
  • 41.5k
101 votes
14 answers
21k views

As I learn more and more about OOP, and start to implement various design patterns, I keep coming back to cases where people are hating on Active Record. Often, people say that it doesn't scale well (...
Adam Tuttle's user avatar
  • 19.9k
100 votes
14 answers
52k views

How should a complex single-page JS web application be structured on the client-side? Specifically I'm curious about how to cleanly structure the application in terms of its model objects, UI ...
user avatar
99 votes
20 answers
74k views

I am unable to get what are the scenarios where we need an immutable class. Have you ever faced any such requirement? or can you please give us any real example where we should use this pattern.
Rakesh Juyal's user avatar
98 votes
4 answers
65k views

Are there any known design principles, best-practices and design patterns that one can follow while designing a C project? Or useful design principles for procedural (imperative) programming in ...
Dimi's user avatar
  • 991
97 votes
3 answers
145k views

Possible Duplicate: Simplest/Cleanest way to implement singleton in JavaScript? I'm using this pattern for singletons, in the example the singleton is PlanetEarth: var NAMESPACE = function () { ...
Kaze no Koe's user avatar
  • 3,254
96 votes
9 answers
28k views

I've been researching the difference between these two patterns. I understand that facade encapsulates access to a sub system and mediator encapsulates the interactions between components. I ...
user avatar
95 votes
2 answers
53k views

I've heard both used to describe the idea of deploying an update on new machines while keeping old machines active, ready to rollback if an issue occurs. I've also heard it used to describe sharing ...
Erich's user avatar
  • 2,132
93 votes
3 answers
145k views

Consider the below two diagrams. The top one contains a plain arrow at the right end, and the bottom one contains an arrow with a diamond at the left end and a plain arrow at the right end. The great ...
Geek's user avatar
  • 27.4k
93 votes
15 answers
16k views

One part of domain-driven design that there doesn't seem to be a lot of detail on, is how and why you should isolate your domain model from your interface. I'm trying to convince my colleagues that ...
Mark Rogers's user avatar
  • 97.9k
92 votes
6 answers
119k views

Angular 1.x (AngularJS) was following more or less the MV* design principle because of its two-way data binding functionality. Angular2 is adopting a component-based UI, a concept that might be ...
AnonDCX's user avatar
  • 2,611
92 votes
0 answers
125k views

What is the best way to implement the singleton pattern in Python? It seems impossible to declare the constructor private or protected as is normally done with the Singleton pattern...
dmanxiii's user avatar
  • 52.3k
91 votes
5 answers
54k views

In large and complex software products managing configurable settings becomes a major pain. Two approaches I've seen to the problem are: have each component in the system load its own configuration ...
oz10's user avatar
  • 159k
90 votes
8 answers
115k views

I understand that the N+1 problem is where one query is executed to fetch N records and N queries to fetch some relational records. But how can it be avoided in Hibernate?
Vipul Agarwal's user avatar
90 votes
6 answers
25k views

I'm looking for some general strategies for synchronizing data on a central server with client applications that are not always online. In my particular case, I have an android phone application with ...
Scott Saunders's user avatar
89 votes
14 answers
65k views

My team and I have been discussing using the CQRS (Command Query Responsibility Segregation) design pattern and we are still trying to asses the pros and cons of using it. According to: http://...
Eric's user avatar
  • 3,832
88 votes
17 answers
18k views

I would like to know what the pros and cons are for using an Anemic Domain Model (see link below). Fowler Article
Steve Horn's user avatar
  • 9,009
88 votes
22 answers
54k views

Name the design considerations in deciding between use of a singleton versus a static class. In doing this, you're kind of forced to contrast the two, so whatever contrasts you can come up with are ...
cdleary's user avatar
  • 71.8k
87 votes
7 answers
66k views

I have a number Processor classes that will do two very different things, but are called from common code (an "inversion of control" situation). I'm wondering what design considerations I should be ...
probably at the beach's user avatar
87 votes
4 answers
80k views

Can someone explain these 3 concepts and the differences between them with respect to an MVC framework along with an example. To me these appear almost equivalent, and it seems they are used ...
Martin Konecny's user avatar
87 votes
4 answers
28k views

First, before anyone screams dupe, I had a hard time summarizing it in a simple title. Another title might have been "What is the difference between a domain model and MVC model?" or "What is a model?...
Erik Funkenbusch's user avatar
86 votes
12 answers
63k views

I always found the Observer Pattern almost similar to the usual event-driven approach. Actually, I have almost believed that they are actually just different names referring to the same thing. They ...
Carven's user avatar
  • 15.8k
86 votes
5 answers
130k views

I am writing RESTful services using spring and hibernate. I read many resource in internet, but they did not clarify my doubts. Please explain me in details what are DAO, DTO and Service layers in ...
Prathap Badavath's user avatar
84 votes
4 answers
47k views

I am building a multiple page admin interface for an internal enterprise software platform. Think lots of glue logic tying together various APIs, db queries, and shell scripts. We will be using node....
Dave Snigier's user avatar
  • 2,613
83 votes
6 answers
115k views

I'm in a situation where I'd like to instantiate an object of a type that will be determined at runtime. I also need to perform an explicit cast to that type. Something like this: static void ...
Odrade's user avatar
  • 7,659