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

learn more… | top users | synonyms (1)

3
votes
2answers
224 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
289 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
740 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
462 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
454 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, ...
48
votes
6answers
41k 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
4k 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
908 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
66k 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
653 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
847 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 ...
3
votes
1answer
189 views

How to prevent hardcoding addresses in a web project?

In a fairly complicated web application, there are almost hundreds of redirecting to another page, or linking to another page, etc. Imagine that you have a page called ...
3
votes
2answers
381 views

Implementing Lazy Registration

I'm interested in setting up Lazy Registration on my website. Ideally, I'd like people to be able to fill out a record that might include their name, email, address, etc. and then record it to a user ...
11
votes
8answers
613 views

What is a good code practice of when to make a function/method for small repetitive code segments?

Many times throughout writing larger programs I have questioned after how many copy and pastes does it make sense to put the code into a function or method and what is a good rule of thumb? I have ...
4
votes
6answers
1k views

How can I improve upon this “pattern”?

I have a series of method calls that all share similar qualities. The basic layout is public void CallDataBase() { Utility sqlHelper = new Utility(); StringBuilder query = new ...
2
votes
1answer
707 views

How to apply design patterns in this scenario

I want to use design patterns for the following scenario. How to? I have classes named Person, Employee and Customer and all of them have their own save, update, get and delete methods. Employee and ...
1
vote
1answer
3k views

Silverlight 5 and MVVM. Do I really need other frameworks? What is the best way for rapid development?

I've been reading and watching videos on MVVM and Silverlight.. I'm pretty new to Silverlight but not new to .NET. Interesting that I used MVVM in my WPF apps without knowing that it's MVVM. I was ...
1
vote
1answer
272 views

Is there a design pattern for managing dependencies?

I'm building a component that manages available resources (JavaScript and CSS files) for a web page. As controls are added to the page, they register and un-register their requirements with this ...
7
votes
2answers
547 views

How can I “get in the know”?

My company posted a job listing to get me a helper. A recruiter called me today and all he kept saying was "MVC this Entity Framework that..." - He sounded shocked when I said the project uses ...
6
votes
2answers
455 views

Patterns to avoid long switch block in UI?

Sometimes you have many entities which have common parts, but also should be addressed uniquely in UI. For example, in a CMS, you have many content types (like news, images, articles, pages, etc.) ...
1
vote
2answers
869 views

Whats the best book to master OO language, say C#? [closed]

I have quite some experience in software development. In the initial stages I worked on a really large project, with dozens of projects involved in it, hundreds of large files each with 10s of ...
0
votes
2answers
241 views

Name for this pattern?

I'm writing a class that will handle thread synchronisation. It would have a begin method which would increment a counter and an end method that would de-increment a counter. It'll have another ...
4
votes
6answers
9k views

Can a fresher from a college write design patterns under “area of interests ” in resume? [closed]

I have keen interest in design patterns. I have been reading a lot about them. Specially, from HEAD FIRST. Can I write about design patterns in my resume? I am a fresher. Going to sit in on-campus ...
17
votes
8answers
3k views

Is writing your own Data Access / Data Mapping Layer a “good” idea?

We're currently in a situation where we have a choice between using an out-of-the-box object-relational mapper or rolling our own We have a legacy application (ASP.NET + SQL Server) where the ...
2
votes
3answers
703 views

GUI: Setting options in two different places and having them stay in sync?

Programming in Windows with Visual Studio 2010 C++ and MFC. My question is about how best to store, update, and pass around program settings or options. I have a simple main GUI window/frame/dialog. ...
21
votes
10answers
5k views

To design pattern, or not to design pattern [duplicate]

Design patterns are good, but complex. Should we use them in small projects? Implementing design patterns needs more sophisticated developers, which in turn raises project costs. On the other hand, ...
8
votes
12answers
942 views

Were you able to implement design patterns in tight deadlines?

I am wondering, in tight deadlines, who has time to implement design patterns? It is a lot more work and programming overhead to get it right the first time and within time frame. I know that it has ...
4
votes
2answers
905 views

How do you decide to Queue/Dispatch events Sync or Async? (in Observer Pattern)

Consider the following elements in an event-driven architecture: Observable Object Event Dispatcher Observer(Listener) Now, we have two messages: From Observable Object to Event Dispatcher From ...
2
votes
3answers
4k views

Has anyone used “Design Pattern Framework (TM)”? [closed]

Has anyone purchased Design Pattern FrameworkTM? Are these samples worth investment? Are they practical? What are the pro and cons of the guidelines? Anyone used this in the real-world development?
0
votes
1answer
154 views

Proxying the multitons

I have an app which acts like a TCP server and accepts multiple connections. Each connection is made by a distinct device, with a unique ID (the ID is reported by the device in two different messages ...
1
vote
3answers
1k views

Is there a canonical book for CMS design patterns and concepts? [closed]

I've been trying to understand the fundamentals of content management systems: I've looked into APress's Pro ASP.NET 4 CMS, but it dives into implementation, dedicating a lot of time to technologies ...
3
votes
2answers
352 views

Application design question regarding saving files

I am working on an application in C# and I am having some extreme difficulty solving this design issue. Basically the application allows users to create cook books. A user can click "new book" and ...
1
vote
1answer
349 views

Design Pattern For UI Control and Provider to Call Control's Events [closed]

I have a UI control that uses a provider class to implement the actual logic of a complex task. So the control delegates to the provider to do some work. But the provider needs to work with the ...
2
votes
1answer
244 views

How should I structure our common modules to maximize reuse and reduce duplication? [duplicate]

Currently I'm working at a .NET project-based company. Our coding is not modularized, mostly we are copy/pasting old code that is needed on a new project and modify it. I was trying to standardize ...
3
votes
10answers
719 views

Does it make sense to ask, “What is the difference between Design Pattern and Algorithm?”

From Wikipedia: In mathematics and computer science, an algorithm is an effective method expressed as a finite list of well-defined instructions for calculating a function. In software ...
1
vote
4answers
176 views

Independent Developer Pre-Coding Planning/Design/Architecture

For the independent developers, or the weeknight/weekend developers, when you are about to begin a large/enterprise project, what are you first steps to take when hashing out the pre-coding details ...
4
votes
4answers
1k views

Can the strategy pattern be overused?

Example: A file, representing a serialized version of an object, needs to be read and deserialized. It would simple to implement this if we only cared about a single serialization format, but many ...
0
votes
1answer
280 views

Designing classes containing the same objects but different amount of them

I am creating a main object, MACHINE, which will contain a diversity of several other objects -- AXIS, AMPLIFIER, ENDEFFECTOR, etc. The number of contained objects will vary depending on the MACHINE ...
0
votes
5answers
163 views

Help me in choosing appropriate pattern

From last one week i was searching for most suitable architecture for a new web application. To be honest i did web development for only 1 year (back in 2007). And from last four years i am working in ...
2
votes
2answers
719 views

Design question: Is this good case for proxy pattern, or “over done”?

Working on a major enhancement for legacy code, I have been wrestling with myself over whether this is a good case to use the Proxy pattern, and more specifically whether a good case to use the Java ...
7
votes
4answers
475 views

OOP design question

I'm working on an application written in PHP using OOP principles. The classes in my application usually represent a table in the database; for instance, 'student', 'teacher', 'class', 'schedule', ...
0
votes
3answers
1k views

Design pattern for a multi-threaded URL fetcher in java

I'm looking for hints and suggestions on a design for a multi-threaded URL fetcher in java. Specific requirements are: To fetch each one of around 1,000 URLs periodically The interval between each ...