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

learn more… | top users | synonyms (1)

9
votes
2answers
2k 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 ...
2
votes
1answer
316 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
822 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 ...
8
votes
4answers
926 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 ...
9
votes
3answers
633 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 ...
24
votes
6answers
4k 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
321 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
521 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
288 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
526 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
3k 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
1k 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 ...
8
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)) ...
25
votes
7answers
20k views

What are the benefits of using Dependency Injection and IoC Containers?

I'm planning to do a talk on Dependency Injection and IoC Containers, and I'm looking for some good arguments for using it. What are the most important benefits of using this technique, and these ...
3
votes
5answers
781 views

Is this technique a design pattern? If so, what's it called?

I'll use C# as an example, but it should apply globally. Say I have a string value that should be one of a few constants, but I also want the client to set which string value to use so: private int ...
7
votes
2answers
343 views

Design Pattern Books, Papers or Resources for Non-Object Orientated Paradigms?

After viewing this video on InfoQ about functional design patterns I was wondering what resources are out there on design patterns for non-object orientated paradigms. There are plenty out there for ...
4
votes
8answers
9k views

What is a “wrapper” program?

Where I work, employees use a third-party desktop program for their clients. This program saves data to a flat file. My colleague wants to write a Java program that uploads that flat file to a remote ...
7
votes
5answers
453 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 ...
4
votes
2answers
9k views

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

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
278 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 ...
2
votes
1answer
266 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?
6
votes
3answers
193 views

System Decoupled in the Wrong Places: Meta-Problem? [closed]

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 ...
15
votes
8answers
4k views

Is the GoF book still the one to read? [duplicate]

Possible Duplicate: Is there a canonical book on design patterns? I'd like to read a design patterns book. GoF for sure is the one to read. But after 15 years is it still valid, I mean ...
3
votes
1answer
271 views

Would this be an effective use of the Subject/Observer pattern, or is there a better way?

TBH: I've never used an observer pattern. But it looks pretty useful for this situation: I'm developing a very simple strategy game. It involves two combatants who simultaneously bludgeon each ...
29
votes
11answers
2k views

Are design patterns generally a force for good or bad? [closed]

I've heard it argued that design patterns are the best thing since sliced bread. I've also heard it argued that design patterns tend to exacerbate "Second System Syndrome," that they are massively ...
17
votes
5answers
850 views

Is loose coupling w/o use cases an anti-pattern?

Loose coupling is, to some developers, the holy grail of well-engineered software. It's certainly a good thing when it makes code more flexible in the face of changes that are likely to occur in the ...
47
votes
5answers
5k views

When is Singleton appropriate? [closed]

Some hold that the Singleton Pattern is always an anti-pattern. What do you think?
49
votes
4answers
16k views

What is inversion of control, and when should I use it?

I am designing a new system and I want to know what inversion of control (IOC) is, and more importantly, when to use it. Does it have to be implemented with interfaces or can be done with classes?