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

learn more… | top users | synonyms (1)

6
votes
2answers
280 views

Should ActiveRecord-based domain models have visible properties? Why or why not?

Should ActiveRecord-based domain models have visible properties? Why or why not? My experience and studies have always lead me to believe that object properties should always be protected, and that ...
7
votes
2answers
472 views

Help me classify this type of software architecture

I read some books about software architecture as we are using it in our project but I can't classify the architecture properly. It's some kind of Enterprise Architecture, but what exactly... SOA, ESB (...
5
votes
4answers
593 views

Where does form processing belong in an MVC application?

I found this question on stack overflow and I have a question about one of the answers: In Zend Framework, forms are typically objects with decorators, but usually (I thought) processing is done ...
11
votes
8answers
1k views

How 'simple' is a real KISS solution? [closed]

I confess: I have a problem to "Keep It Simple and Short" most of the time because trying to make it according to the books I have read, design-patterns I have heard etc. gives me such an enthusiasm -...
3
votes
2answers
2k views

How do you organize an ASP.NET MVC 3 application with potentially hundreds of views but with only a few entry points?

Assumptions: Minimalist ASP.NET MVC 3 application for sending emails where the view represents the contents of an email. Over 500+ email types. I would NOT like to have 500+ actions in my controller ...
2
votes
3answers
641 views

RFC: Extending the MVC Design Pattern

I've been using the MVC pattern in my applications for years (with full separation of the controller from its views). Having to implement several hundred views to represent a little over 100 model's ...
2
votes
2answers
924 views

Translating objects from one type to a another

I am working on a server-client app in c# and need to send an object from the client to the server via WCF. For simplicity I will call it WorkingClass as it is what does the work. public class ...
7
votes
2answers
478 views

Is there a standard, formal name for an object or class that behaves as if it is a given object?

I have an app in Django that expects to get a record with the fields email, first_name, and last_name. However, sometimes I want to be able to send it something that isn't actually a record but ...
44
votes
6answers
15k views

Is object pooling a deprecated technique?

I am very familiar with the concept of object pooling and I always try to use it as much as possible. Additionally I always thought that object pooling is the standard norm as I have observed that ...
4
votes
2answers
1k views

Which GOF design patterns work well with TDD, and which do not?

The GOF Design Patterns book rarely mentions the test-ability of each pattern. I'm aware that there are patterns such as Singleton that would lead to code for which it is difficult to write unit tests,...
1
vote
2answers
531 views

Am I using Factory and Impl classes properly?

In my 2d destruction derby simulator I have a CargoTruck class and CargoTruckImpl that implement an interface called Truck. CargoTruck has a reference to CargoTruckImpl which is returned through the ...
10
votes
9answers
2k views

Is this an anti-pattern?

I've seen this a lot in our legacy system at work - functions that go something like this: bool todo = false; if(cond1) { ... // lots of code here if(cond2) todo = true; ... // some other ...
5
votes
1answer
549 views

Architecture: for a Single website to be supported for different Clients

I have developed a system with one company profile. The system is built using WCF services, asp.net. Now another company wants to use our system as well. And they might need some customization and ...
20
votes
2answers
7k views

DDD - Does an aggregate root's repository handle saving aggregates?

I am using a DDD-like approach for a greenfield module of an existing application; it's not 100% DDD due to architecture but I'm trying to use some DDD concepts. I have a bounded context (I think ...
1
vote
3answers
853 views

Recommended content for layers

As an expansion from my previous question about using separate projects for seperate layers - Good practice on Visual Studio Solutions I now wish to know if I am putting the right functionality in ...
2
votes
2answers
81 views

Should one define an interface and code an adapter for it whenever a dependency is found?

Given a particular third-party class/library you want to make use of, the simplest thing to do would be to just hardcode API calls to it through your application. On the other hand you have the ...
4
votes
3answers
443 views

What is the name for this variation to Adapter Pattern?

Introduction An Adapter normally wraps another object, so that it can be used in an interface it wasn't designed for, e.g., when you want to use interface Node { Node parent(); Iterable<...
2
votes
1answer
189 views

Is a multi-page web app unsuitable when reliable server pushes are required?

Imagine a call center web application with a soft phone that automatically detects when a call has started or the caller has hung up. The obvious approach to receiving these messages would be some ...
4
votes
1answer
864 views

When should the presentation model design pattern include one or more controllers?

I have been researching the usage of the Presentation Model design pattern for an application I am preparing to build. The specific technology I will be using is Flex though I doubt that it matters ...
4
votes
2answers
234 views

Designing around the constraints of external services in a client-server architecture

Suppose you have a client that interfaces with a server which in turn invokes an external service to fulfill some of the client's requests. I'm designing the client and server and need to accommodate ...
3
votes
2answers
653 views

Examples of MVVM adoption outside the Microsoft community?

IS MVVM getting any kind of traction outside the Microsoft community? Within Silverlight this is a non-issue, but for other technologies, like JavaScript it surely is: For instance Knockout.js is a ...
5
votes
8answers
2k views

Do I need to learn Design Patterns if I'm preparing to be Android Developer? [closed]

Please advise if it is required to learn design patterns if I'm studying for Android development?
14
votes
3answers
2k views

Tips/advice on how to reduce the use of “manager” classes?

I sometimes hear that having too many "manager" classes in your program's design is code smell and add an unnecessary layer of complexity. To me it makes sense that people want to use manager classes ...
0
votes
1answer
132 views

Name for WS pattern where a generic object is returned? [closed]

Two part question: I am working on a project where the webservices all return a generic object. On success, that object then contains the data returned from the webservice along with additional ...
2
votes
4answers
375 views

Is there a pattern for subscribing to fired events/messages at specific intervals?

I'm not sure if this a common scenario or not, but I have a need along the following lines: I have an object (I'll call it node) and this object has methods X, Y, and Z. I want to be able to have ...
5
votes
1answer
131 views

Checking members and instantiating in properties

Consider this: public MyClass { private Resource _myResource; public Resource MyResource { get { if(_myResource == null) { ...
5
votes
2answers
496 views

Trying to identify IClass, Class, ClassImpl pattern

I've been seeing a lot of code recently that looks like this: public interface IFoo { int Bar(); } public static class Foo { public static IFoo Create() { return new FooImpl(); } private ...
6
votes
1answer
6k views

Implementing a DAO for entity framework [closed]

Could anybody help me to find a good tutorial about how can I implement DAO pattern and also tools that help me to create this classes in automated way.
12
votes
8answers
1k views

Algorithm Vs Design [duplicate]

Possible Duplicate: Is it essential to learn algorithms to be a real programmer? This question is, perhaps, related mostly to web developers who, like myself, code enterprise applications and ...
10
votes
3answers
1k views

Recommend a design pattern/approach to exposing/tolerating/recovering from system errors, Exception handling (e.g.s in Java, C++, Perl, PHP)

Can you recommend a design pattern/approach to exposing/tolerating/recovering from system errors, Exception handling (Java, C++, Perl, PHP)? Some errors need to be reported. Some errors can be ...
4
votes
3answers
1k views

How do you call a “Proxy” that delegates to *several* implementations?

In a traditional GoF Proxy, you have an Interface, an Implementation, that implements the Interface, and a Proxy that also implements the Interface, references an instance of Implementation, and ...
4
votes
4answers
256 views

Are there any languages built to facilitate implementing design patterns?

Often it is not obvious how to implement a given design pattern in a language. Sometimes it is difficult or cumbersome. Are there any languages built to make using design patterns easy and effective?
73
votes
14answers
5k views

What should take precedence: YAGNI or Good Design?

At which point should YAGNI take precedence against good coding practices and vice versa? I'm working on a project at work and want to slowly introduce good code standards to my co-workers (currently ...
16
votes
4answers
4k views

Does anyone have a specific example of using the Flyweight Pattern?

I have been studying design patterns and came accross the fly weight pattern. I have been trying to see opportunities to use the pattern in my applications but I am having trouble seeing how to use ...
1
vote
3answers
1k views

what are your web application server side layering design rules and the best practices you like to apply?

A web application is often designed to be layered. Typically there would be a Repository (Dao) layer, a Service layer and a Control (web handling) layer. The Control layer uses the Service layer which ...
14
votes
14answers
8k views

How can I explain the usefulness of Inheritance? [closed]

When trying to explain the concept of Inheritance in OOP, the common example is often the mammals example. IMHO, this is really a bad example, because it will lead the newbies to use this concept the ...
2
votes
1answer
629 views

Login with Twitter or Facebook - How to link accounts

I've been developing a site and I've been trying to come up with a method to make sure all Social Network accounts of a certain user are linked together. I've had one snag from the start, and maybe ...
4
votes
7answers
2k views

What to do with obsolete code? [closed]

Code that we no longer use builds up. So what should one do when one doesn't need it anymore? Deleting it feels wasteful, especially large chunks, and there's always the chance the exact same thing ...
6
votes
5answers
1k views

How often do you actually use design patterns? [duplicate]

Possible Duplicate: Are design patterns really essential nowadays? I recently read a book on design patterns. A few of them seem very usefull in specific situations. Im not sure how much use ...
5
votes
3answers
3k views

What should I name this helper class? [closed]

Usually when writing unit tests I create a helper class with extension methods. I use these methods exclusively for generating generic data for things that I am too lazy to type out. I usually name ...
8
votes
4answers
480 views

Is there is a case when there is no any reasonable replacement for singleton design pattern? [duplicate]

Possible Duplicate: When is Singleton appropriate? I've seen many explanations why is Singleton is evil. But is there really no such a case when Singleton is the only beautiful solution?
16
votes
4answers
494 views

Is there a specific design strategy that can be applied to solve most chicken-and-egg problems while using immutable objects?

Coming from a OOP background (Java), I'm learning Scala on my own. While I can readily see the advantages of using immutable objects individually, I'm having a hard time seeing how one can design a ...
9
votes
2answers
2k views

Observer pattern over HTTP and TCP/IP (Server-Client)

I have a server and many clients (around 50 clients) who connect to that server based on a web application, which is of course based on HTTP protocol, which in turn uses TCP/IP (correct me if I'm ...
3
votes
2answers
365 views

How to handle fired listeners exceptions

This is more of a design question and i was hoping to get pros and opinions on what makes sense. BACKGROUND Imagine something that holds one or more event listeners. Every now and then the thing ...
12
votes
1answer
1k views

Patterns for ajax-heavy web applications

Up until now, I've been a great fan of the MVC pattern for developing web applications. For the web, I've developed mostly in PHP (with the Kohana and CodeIgniter frameworks) and Ruby (RoR). As my ...
1
vote
2answers
322 views

Difference between templates in JavaScript and design patterns

What is the difference between templates and design patterns in JavaScript? I read about the template method design pattern and now I wonder how it relates to JavaScript templates (if at all).
0
votes
2answers
2k views

What are the current problems involved in software engineering programming patterns? [closed]

can someone suggest me the current problems in software engineering and the research links for it? i have some knowledge on MVVM being a pattern but i would like to know more about others and also ...
7
votes
11answers
1k views

What kind of questions and processes do you ask yourself and follow when designing software? [closed]

I've read books on design, I troll the internet for articles on best practices and software design principles. However, I always seem to struggle to put into practice the kind of suggestions and ...
32
votes
10answers
6k views

Difference between Idiom and Design Pattern?

What is the difference between idiom and design-pattern? It seems that these terminologies overlap somewhere; where exactly, I don't know. Are they interchangeable? When should I use what? Here is a ...
5
votes
2answers
562 views

What pattern helps to compose nested views at runtime?

Are there any design patterns to compose views within a parent view during runtime? Say we are composing the views in a workflow tab and views in the tabcontrol depend on the country, store type and/...