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
461 views

“Don't cross the streams” Database access objects independant of the Data tier in an N-Tier architecture?

I'm adding functionality to our website which performs long-running processes asynchronously using MSMQ. Doing this ansynch, however means we need to notify users when their requests are completed. ...
1
vote
3answers
288 views

How do you organize a large data layer in a project?

I have a data layer that strictly interacts with the database and returns the result into a model. I have an asynchronous connection with the DB so sometimes I have to chain results where I have to ...
4
votes
3answers
801 views

Usage of Repository Pattern

I'm using the Repository pattern in my application right now. It is a console-based batch processing tool. Essentially I need the repository to be able to randomly access the data. The trouble I am ...
27
votes
11answers
2k views

Well designed / high-quality open source software [closed]

I'm taking a software design class where I should choose an open source software to analyze from the Software Design point of view. It has to be a big project: not less then 100,000 lines of code. I ...
4
votes
4answers
2k views

How to figure out real life examples of design patterns?

Hi I am learning design patterns from a book . How to figure out the actual production code where it is implemented . For example , if I am learning strategy pattern , it might be implemented ...
0
votes
1answer
625 views

Building a table (DataGridView) while keeping decoupled from Model

I'll try to keep this simple. Small C# app, dialog based, one has a DataGridView. I've got an UpdateTable function in the form that accepts a DataSet and passes it to the DataGridView.DataSource. ...
10
votes
9answers
2k views

How should you explain Design Patterns to people outside of Software World

I want to explain design patterns to my niece, but always struggle in doing so. It is largely due to my lack of clear understanding of design patterns. How do you suggest explaining patterns like ...
3
votes
2answers
1k views

user security pattern recommendation/best practice

I'm looking for good reference on patterns that apply to user security and ACLs for multi-user network applications. I'm re-writing a fairly large application from scratch. Now I'm looking at the ...
8
votes
2answers
534 views

Which GOF design patterns are already implemented as first-class language features in C#?

(This question was closed on Stack Overflow due to being "too broad" and "not a real question" so maybe it's more appropriate here?) Inspired by this question. We know events are a language-level ...
18
votes
2answers
4k views

Should I read “Head First Design Patterns” as my first design pattern book? [closed]

I'm planning to read a book to gain some good knowledge of design patterns, why we use them, how to apply them and how to choose the best design for my software. So I have two books on my desk right ...
1
vote
1answer
303 views

Model-view-presenters and user-interactions involving separate dialogs

I have a UI form written using model-view-presenter that has, among other things, a listbox containing a number of different domain objects. The form also contains an add/update button which pulls up ...
16
votes
3answers
3k views

How to store prices that have effective dates?

I have a list of products. Each of them is offered by N providers. Each providers quotes us a price for a specific date. That price is effective until that provider decides to set a new price. In ...
16
votes
4answers
11k views

Model-View-Presenter implementation thoughts

I'm trying to get a good grasp of how to implement good decoupling between a UI and the model, but I'm having trouble figuring out exactly where to divide the lines. I've been looking at ...
4
votes
1answer
288 views

Will Design Patterns Help me in this case?

recently I have been given a task of finding the combinations of the given word. For example, say The given word is like then possible answers are liek,lkie and so on. This has to be implemented in ...
9
votes
1answer
497 views

When is a glue or management class doing too much?

I'm prone to building centralized classes that manage the other classes in my designs. It doesn't store everything itself, but most data requests would go to the "manager" first. While looking at an ...
83
votes
21answers
7k views

Is OOP hard because it is not natural?

One can often hear that OOP naturally corresponds to the way people think about the world. But I would strongly disagree with this statement: We (or at least I) conceptualize the world in terms of ...
6
votes
3answers
1k views

Duplication in parallel inheritance hierarchies

Using an OO language with static typing (like Java), what are good ways to represent the following model invariant without large amounts of duplication. I have two (actually multiple) flavours of the ...
9
votes
5answers
1k views

Modified Strategy Design Pattern

I've started looking into Design Patterns recently, and one thing I'm coding would suit the Strategy pattern perfectly, except for one small difference. Essentially, some (but not all) of my ...
2
votes
2answers
1k 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
373 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 ...
9
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
610 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
320 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
1k 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
496 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
720 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 ...
40
votes
15answers
14k 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
4k 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
802 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 ...
11
votes
3answers
5k 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
287 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
965 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
2k 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
680 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 ...
10
votes
5answers
925 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
379 views

Giving a presentation on “code style and design patterns”

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 ...
252
votes
13answers
69k 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
861 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() ...
4
votes
4answers
3k 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 ...
6
votes
4answers
276 views

How should I evaluate a training class?

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
702 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 ...
5
votes
1answer
379 views

The use of Test-Driven Development in Non-Greenfield 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 ...
13
votes
5answers
6k 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
477 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 ...