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

learn more… | top users | synonyms (1)

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 ...
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 ...
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 ...
9
votes
6answers
404 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 ...
23
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 ...
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 ...
2
votes
2answers
765 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
223 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
681 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 ...
1
vote
1answer
282 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 ...
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 ...
8
votes
2answers
737 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 ...
8
votes
3answers
561 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 ...
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 ...
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 ...
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)) ...
2
votes
1answer
241 views

Why doesn't DDD consider Documents?

... that is, the inputs and outputs of service functions ? Are entities, or aggregates, allowed to leave service boundaries?
7
votes
5answers
445 views

How can we make software development best practices more interesting to people without a software background?

Where I work there are a few experienced software developers with a software background, but the majority of developers are physicists or chemists with excellent domain knowledge but limited ...
7
votes
2answers
8k views

What sort of Design Patterns do you use in Android Development?

I have been developing on Android for a couple months now, and building upon one in house program I found the scalability to be lacking. I have that gut feeling that if I applied some OO Design ...
0
votes
1answer
263 views

What design pattern is best suitable with this context?

I have a base class Shape, and drived classes Line Segment, Arc, B-spline,... I want to find the intersection point between these shapes. I would like: Shape* a = new LineSegment(); Shape* b = new ...
8
votes
3answers
178 views

System Decoupled in the Wrong Places: Meta-Problem?

At a meta level, I often find that when I grow a codebase organically, parts of the system that I eventually find need to know about each other (at least through some interface) have been mercilessly ...