Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [design-patterns]

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

3
votes
3answers
81 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 ...
10
votes
4answers
2k 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 ...
11
votes
8answers
1k 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 ...
31
votes
6answers
12k 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
1answer
326 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. ...
5
votes
2answers
540 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 ...
32
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 ...
7
votes
2answers
299 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
606 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!
7
votes
6answers
5k 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 ...
4
votes
2answers
2k 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 ...
2
votes
2answers
5k 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 ...
10
votes
2answers
2k 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)) ...
59
votes
5answers
59k 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
803 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 ...
8
votes
2answers
427 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 ...
7
votes
8answers
15k 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 ...
8
votes
5answers
474 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 ...
1
vote
1answer
306 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 ...
3
votes
1answer
272 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
3answers
209 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 ...
19
votes
8answers
7k 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 isn't ...
4
votes
1answer
344 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 ...
32
votes
11answers
4k 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 ...
22
votes
6answers
1k 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 ...
24
votes
16answers
68k views

What is the most frequently used design pattern? [closed]

Which design pattern do you think is the most popular?
63
votes
5answers
10k views

When is Singleton appropriate? [closed]

Some hold that the Singleton Pattern is always an anti-pattern. What do you think?
64
votes
4answers
22k 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?