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

learn more… | top users | synonyms (1)

4
votes
1answer
424 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 ...
15
votes
2answers
5k 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 ...
2
votes
3answers
710 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
72 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
408 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(); ...
2
votes
1answer
170 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
672 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
156 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
611 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 ...
3
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?
11
votes
3answers
1k 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
130 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
299 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
125 views

Checking members and instantiating in properties

Consider this: public MyClass { private Resource _myResource; public Resource MyResource { get { if(_myResource == null) { ...
5
votes
2answers
427 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
5k views

Implementing a DAO for entity framework

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
995 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 ...
9
votes
4answers
722 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
971 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 ...
3
votes
4answers
241 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?
70
votes
14answers
4k 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 ...
13
votes
4answers
2k 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
879 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
6k views

What would be the best real example to 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
575 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 ...
5
votes
3answers
2k 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
464 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
378 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 ...
4
votes
2answers
1k 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
215 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 ...
11
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
285 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
1k 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
733 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
4k 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
455 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 ...
9
votes
4answers
447 views

Is it okay to have many Abstract classes in your application?

We initially wanted to implement a Strategy pattern with varying implementations of the methods in a commmon interface. These will get picked up at runtime based on user inputs. As it's turned out, ...
47
votes
6answers
40k views

Why should I use an MVC pattern?

It seems everyone doing web applications nowadays wants to use MVC for everything. I find it hard to convince myself to use this pattern, however. I understand the general idea is to separate the ...
4
votes
2answers
1k views

Is there a name for this design pattern, using hooks/callbacks?

I've seen/used some objects that have a structure like so, designed to let children extend the functionality of functions without having to override them. Is there a name for this pattern? code ...
11
votes
1answer
3k views

What is the difference between the Controller in MVC and ViewModel in MVVM?

I can't see the difference between MVC and MVVM clearly. I feel the Command in a ViewModel is just like the Action method in a Controller. And both the Controller and ViewModel will notify the View to ...
12
votes
2answers
1k views

Is it better to have separate Create and Edit actions or combine Create and Edit into one?

We are using ASP.NET MVC 2 with a Controller/View Presentation Layer and Model consisting of A Business Logic Layer, Data Access Layer [Stored Procedures and classes/methods to talk to the stored ...
19
votes
8answers
3k views

How to implement DRY principle when using 'using' keyword?

Consider these methods: public List<Employee> GetAllEmployees() { using (Entities entities = new Entities()) { return entities.Employees.ToList(); } } public ...
5
votes
1answer
893 views

Object oriented EDI handling in PHP

I'm currently starting a new sub project where I will: Retrieve the order information from our mainframe Save the order information to our web-apps' database Send the order as EDI (either D01b or ...
171
votes
18answers
65k views

How can one manage thousands of IF…THEN…ELSE rules?

I am considering building an application, which, at its core, would consist of thousands of if...then...else statements. The purpose of the application is to be able to predict how cows move around in ...
2
votes
1answer
197 views

what is the correct/best way to populate a secondary property of an MVC Model and how do I unit test it?

I'm building an web application is ASP.NET MVC 3 (.NET 4) and trying to unit test as much as possible. I have a controller action Details(int customerId) which should display a view who's model is a ...
5
votes
6answers
640 views

Is this considered repeating code?

C#/ASP.net: /// <summary> /// Is a group in the basket already? /// </summary> public static bool isItemInBasket(List<BasketItem> BasketItems, int GroupID) { return ...
17
votes
5answers
4k views

When would polling for events be better than using observer pattern?

Are there scenarios where polling for events would be better than using the observer pattern? I have a fear of using polling and would only start using it if someone gave me a good scenario. All I can ...
3
votes
3answers
846 views

New Silverlight app. MVVM. RIA Services vs CSLA

Another 2 days of reading and watching demos and here we go. For my enterprise LoB Silverlight app I'm going to use: Prism for UI aspects and modularity. MVVM pattern (using Prism) ??? to bring ...