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

learn more… | top users | synonyms (1)

3
votes
2answers
2k views

Anemic Domain Model, Business Logic and DataMapper (PHP)

I've implemented a rudimentary ORM layer based on DataMapper (I don't want to use a full blown ORM like Propel/Doctrine - for anything beyond simple fetch/save ops I prefer to access the data directly ...
2
votes
7answers
1k views

Architectural patterns for interaction beyond MVC? [closed]

We all know the venerable Model-View-Controller pattern used to design interaction [mostly] with human users. It is the de-facto standard in OOP environment. What are some other architectural ...
4
votes
3answers
383 views

MVP Pattern Philsophical Question - Security Checking in UI

I have a philosophical question about the MVP pattern: I have a component that checks whether a user has access to a certain privilege. This privilege turns on or off certain UI features. For ...
1
vote
4answers
3k views

When designing an application around Model-View-Controller (MVC), what is in your toolbox?

There are a lot of great explanations for what the Model-View-Controller design pattern is, but I am having trouble finding good resources showing how to use it in practice. So, when you are starting ...
10
votes
1answer
4k views

Software architecture for authentication/access-control of REST web service

I am setting up a new RESTful web service and I need to provide a role-based access control model. I need to create an architecture that will allow users to provide their username and password to get ...
3
votes
3answers
643 views

How to make an app more intuitive? [closed]

In the industry, there are few standard checklists on how to make a web application more : Scalable Easy to understand/maintain Perform better Robust etc. etc. Are there any standard checklists ...
1
vote
8answers
325 views

Identifying which pattern fits better

I'm developing a software to program a device. I have some commands like Reset, Read_Version, Read_memory, Write_memory, Erase_memory. Reset and Read_Version are fixed. They don't need parameters. ...
3
votes
4answers
2k views

How to learn the practical uses of design patterns

I use OOP programming with inheritance, but I've not yet used interfaces.I want to learn how to use design patterns, but I'm finding them very difficult to learn. Is there is any way to learn design ...
1
vote
5answers
546 views

Ways of handling asynchronous receive calls

I am implementing a primitive message-passing system. Currently, I am designing a receive function for async calls. Can I implement such a async receive function without using callback functions?
4
votes
2answers
851 views

What are the best patterns/designs for stateful API development?

I am about to implement a API for my TCP/IP server written in Java. Right now I have a temporary method that takes a String, executes a command based on the String and returns a String basically like ...
41
votes
15answers
19k views

When should I use—and not use—design patterns? [duplicate]

In a previous question of mine on Stack Overflow, FredOverflow mentioned in the comments: Note that patterns do not magically improve the quality of your code. and Any measure of quality ...
16
votes
10answers
2k views

GoF Design Patterns - which ones do you actually use? [closed]

I'm trying to educate my colleagues in the area of design patterns. Some of the original Gang of Four patterns are a little esoteric, so I'm wondering if there is a sub-group of "essential" patterns ...
20
votes
12answers
5k views

What design patterns are the worst or most narrowly defined? [closed]

For every programming project, managers with past programming experience try to shine when they recommend some design patterns for your project. I like design patterns when they make sense or if you ...
7
votes
4answers
924 views

Modular Architecture for Processing Pipeline

I am trying to design the architecture of a system that I will be implementing in C++, and I was wondering if people could think of a good approach, or critique the approach that I have designed so ...
12
votes
3answers
6k views

How do I set up MVP for a Winforms solution?

I have used MVP and MVC in the past, and I prefer MVP as it controls the flow of execution so much better in my opinion. I have created my infrastructure (datastore/repository classes) and use them ...
1
vote
5answers
296 views

Does this have a name? DRY overloading?

public int foo(int x) { int defaultValue = 0; return foo(x, defaultValue); } public int foo(int x, int y) { return x + y; }
6
votes
1answer
1k views

How best to design Access Control Layer in n-tier architecture application

This is a typical architecture scenario for a 3-tier design: UI-tier Has Graphical User Interface components Middle-tier Has business logic including the following layers: Data Access Layer ...
12
votes
3answers
3k views

Recommended order for learning design patterns? [closed]

I can't help but notice the amount of design patterns that are out there. Does anyone have suggestions on an order I should learn them in? Or should I pick and choose them at random? The only one I ...
2
votes
3answers
743 views

Design Patterns in Delphi [closed]

Delphi has a few problems implementing some design patterns because some features it lacks, like multiple inheritance and no pure abstract classes. Are there any good resources or ...
11
votes
5answers
1k views

Do you leverage the benefits of the open-closed principle?

The open-closed principle (OCP) states that an object should be open for extension but closed for modification. I believe I understand it and use it in conjunction with SRP to create classes that do ...
8
votes
6answers
1k views

Better Understand the 'Strategy' Design Pattern

I have been interested in design patterns for a while and started reading "Head First Design Patterns". I started with the first pattern called the 'Strategy' pattern. I went through the problem ...
9
votes
6answers
405 views

Giving a presentation on “code style and design patterns” [closed]

My company (small, about 40 people across 3 offices) occasionally does "developer workshops" online where one of the devs hosts a presentation about some tech topic. It's not necessarily about our ...
311
votes
13answers
92k views

So Singletons are bad, then what?

There has been a lot of discussion lately about the problems with using (and overusing) Singletons. I've been one of those people earlier in my career too. I can see what the problem is now, and yet, ...
2
votes
6answers
912 views

Is “call and return” a pattern or an antipattern?

Imagine to have this code: class Foo: def __init__(self, active): self.active = active def doAction(self): if not self.active: return # do something f=Foo(false) f.doAction() ...
5
votes
4answers
4k views

Why GRASP patterns are less known than GOF ones?

Design patterns help developers to improve the quality of their design, but only GOF patterns are very known, and paterns like GRASP that gives a good concepts like Information Expert,low coupling and ...
7
votes
3answers
2k views

Design pattern for window management in a Java Swing app

I've just started creating my very first little Java Swing app. When the program opens, it brings up a single, simple window with a label and a couple buttons. Clicking one of those buttons is ...
5
votes
4answers
293 views

How should I evaluate a training class? [closed]

My company is giving us the possibility to sign up for some offsite training classes on Design Patterns. Browsing through the brochures, I'm already feeling bored (and somewhat repelled by the ...
25
votes
7answers
2k views

The Singleton Pattern [duplicate]

Possible Duplicate: When is Singleton appropriate? I am a new programmer (4 months into my first job) and have recently taken an interest in design patterns. One that I have used recently ...
2
votes
2answers
785 views

Multithreaded UI desktop application issues

I am involved into development a rich UI project: desktop windows application. Application uses asynchronous invocations and in its turn it should be ready to process external messages (events). The ...
7
votes
1answer
463 views

Can Test-Driven development work in legacy projects?

So here is a question for you, having read some great answers to questions such as Test-Driven Development - Convince Me. So my question is: "Can Test-Driven Development be used effectively on ...
16
votes
5answers
9k views

What is the difference between all-static-methods and applying a singleton pattern?

I am making a database to store information about the users of my website (I am using stuts2 and hence Java EE technology). For the database I'll be making a DBManager. Should I apply singleton ...
3
votes
2answers
502 views

Is is common to use the command pattern for property get/sets?

Suppose I have a controller class with a bunch of properties. Each time a property is changed, I would like to update the model. Now also suppose that I use the command pattern to perform model ...
5
votes
1answer
224 views

Need to re-build an application - how?

For our main system, we have a small monitor application that sits outside our network and periodically tries to log in to verify the system still works. We have a problem with the monitor though in ...
6
votes
2answers
689 views

How to program for constraints/rules

First the background, during interviews in the past, many times I have been asked to design some or other variation of card game as programming puzzle, and I have tried to design it in OO way, but I ...
9
votes
2answers
1k views

design pattern for unit testing? [duplicate]

I am beginner in developing test cases, and want to follow good patterns for developing test cases rather than following some person or company's specific ideas. Some people don't make test cases and ...
1
vote
1answer
289 views

PHP objects with configurable data interfaces

I have a User class which needs to load data from a variety of sources, e.g. the main user database, WordPress user metadata, authorizations from another app, etc. For the sake of organization, I want ...
8
votes
2answers
745 views

Do Ruby (and other dynamic language) programmers use IoC / Dependency Injection?

I'm primarily an ASP.NET developer and the single thing i've been introduced to in recent years that has had the most dramatic impact on the quality of the code I write has learning how to use IoC ...
3
votes
3answers
77 views

How to manage tailored/branded web tools?

We produce a number of analysis tools which we re-brand and customise for other businesses to include in their websites. The tools are typically product comparison, data/trend analysis and report ...
7
votes
4answers
841 views

Refactoring in domain driven design [closed]

I've just started working on a project and we're using domain-driven design (as defined by Eric Evans in Domain-Driven Design: Tackling Complexity in the Heart of Software. I believe that our project ...
8
votes
3answers
573 views

Best way to model a singleton in a relational database

When designing relational database schema for web applications, I often find a case where I end up creating a table just to contain one row, and only one row. It feels like that is the wrong way to ...
22
votes
6answers
3k views

How much business logic should be allowed to exist in the controller layer?

Sometimes we have some business logic represented in the controller code of our applications. This is usually logic that differentiates what methods to call from the model and/or what arguments to ...
4
votes
1answer
316 views

MVC for our application?

There are some issues about how to manage our program designs and programming styles. I was assigned to find a solution to write reusable code - though, the programming team does not follow the rules. ...
4
votes
2answers
511 views

ORM domain design pitfalls

Are there any patterns which seem sensible when designing an object oriented domain, but do not translate nicely onto a relational database schema? If so, are there standard patterns that can be used ...
30
votes
7answers
2k views

Design Patterns for Javascript [duplicate]

A lot of web frameworks have a MVC-style layout to code and approaching problems. What are some good similar paradigms for JavaScript? I'm already using a framework (jQuery) and unobtrusive js, but ...
6
votes
2answers
287 views

Do you experiment with unconventional ways to use design patterns?

We stick to standard usages and best practices because they work and communicate intent well, but without trying new things we can't really grow. Have you ever tried something that seemed absurd but ...
3
votes
4answers
502 views

Which one of the SOLID principles had the largest effect on your code? [closed]

Which if the SOLID principles introduced by "Uncle Bob" Martin had the largest effect on your day to day coding? Please give details!
6
votes
6answers
2k views

Highly scalable and dynamic “rule-based” applications?

For a large enterprise app, everyone knows that being able to adjust to change is one of the most important aspects of design. I use a rule-based approach a lot of the time to deal with changing ...
5
votes
3answers
966 views

Do you know of a data-pump design pattern?

I frequently encounter a situation where I need to write a program which reads data-objects from a file or system, does a transformation on the data, convert the data to another datamodel and then ...
1
vote
2answers
2k views

What are the responsibilities of a Manager and of the Dao Layers

In several projects we have been using the following layers: Action (has 1 or more managers) Manager(has 1 or more Daos) Dao But most of the time the manager only calls the dao. We do use the ...
7
votes
2answers
1k views

Static Create method — pros and cons compared with constructors

What are the pros and cons of having static object creation methods over constructors? class Foo { private Foo(object arg) { } public static Foo Create(object arg) { if (!ValidateParam(arg)) ...