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

learn more… | top users | synonyms (1)

-2
votes
3answers
236 views

terms for the html/css/javascript model?

Are there any words for the design model implemented by HTML + CSS + JavaScript, either for that specific set of technologies or any abstract pattern that they follow?
17
votes
3answers
3k views

How to design website workflow?

I have been thinking about this for really long time without reaching an optimum answer. First of all, I'm a medical doctor who loves programming but never really studied it, except for home learning ...
10
votes
2answers
10k views

Implementing the command pattern in a RESTful API

I'm in the process of designing an HTTP API, hopefully making it as RESTful as possible. There are some actions which functionality spreads over a few resources, and sometime needs to be undone. I ...
5
votes
4answers
1k views

Is there something like a polymorphic Singleton?

I have a resource loader object that loads objects from the disk or from a ZIP archive, depending on the platform. It has state (e.g. the path to the directory or the ZIP archive, and possibly some ...
11
votes
3answers
746 views

Is using unit tests to tell a story a good idea?

So, I have an authentication module I wrote some time ago. Now I'm seeing the errors of my way and writing unit tests for it. While writing unit tests, I have a hard time coming up with good names and ...
27
votes
2answers
23k views

MVCS - Model View Controller Store

I recently decided to start learning iOS Development, and to this end I’ve been reading iOS Programming: The Big Nerd Ranch Guide. In the book the authors describe a design pattern MVCS - Model-View-...
2
votes
1answer
615 views

Does it make sense to create a Ruby wrapper to reference a Java object that does exactly the same thing?

I am using JRuby. In my Java code, I have a class called Texture, capable of doing some graphic manipulation stuff. In my Ruby code, I will usually need to draw things, so though I should simply ...
11
votes
1answer
4k views

Are we using the repository pattern right?

We are using a bunch of separate classes suffixed with -repository to retrieve the data from the database; for each table its own repository. We have for instance a customerrepository class which has ...
4
votes
3answers
965 views

Is there a design pattern to solve this problem?

I've been struggling with a design so I figured I'd ask here and see if anyone's able to help :) High level overview I'm designing an app to gamify exercise by creating mini competitions (ex. Who ...
2
votes
3answers
1k views

Implementing Command Pattern in Web Application

I'm looking to implement the command pattern in a web application (asp.net c#)... Since the commands come in text format from the client, what is the best way to translate the string to a command ...
9
votes
3answers
5k views

How do you handle multiple users editing the same piece of data in a webapp?

There's a project I'm working on that is looking to produce a web application that will manage a task list between multiple users. This is a master task list whose task items get distributed by an ...
2
votes
1answer
312 views

In JSF where do objects like PhaseListeners fit in the MVC pattern?

When it comes to JSF, I've had trouble distinguishing where certain objects I create fit into the overall MVC pattern. The View is simple enough since that's handled by the .xhtml template but when ...
3
votes
1answer
779 views

Java Logfile Parsing Assistance

I'm writing a log parser that continuously looks for specific patterns and then fires off events to another system when it finds these matches. The firing of the event is time critical to catch errors ...
10
votes
7answers
902 views

Is the use of security conditionals in a view a violation of MVC?

Often what's displayed to a user (e.g. on a web page) will be based partly on security checks. I usually consider user-level / ACL security to be part of the business logic of a system. If a view ...
1
vote
2answers
465 views

Implementing the transport layer for a SIP UAC

I have a somewhat simple, but specific, question about implementing the transport layer for a SIP UAC. Do I expect the response to a request on the same socket that I sent the request on, or do I let ...
3
votes
4answers
3k views

Good design pattern for a c++ wrapper around a c object

I have written an extensible c++ wrapper around a very hard to use but also very useful c library. The goal is to have the convience of c++ for allocating the object, exposing its properties, ...
2
votes
1answer
360 views

Why does Java MessageDigest.getInstance() have a String as a parameter?

I presume it's that way so it could be extended with custom algorithms, but wouldn't it be more convenient to apply, let's say, factory method pattern here and avoid the whole NoSuchAlgorithmException ...
0
votes
2answers
136 views

2 different tasks in template method

I've read about Template Method Pattern but I'm not sure about one thing. The steps (methods) of an algorithm are supposed to be in the template method. In the case my template method's algorithm is ...
2
votes
2answers
229 views

Designing entities to be self-manageable

Although this is a gamedev project, the question is about general OOP practices, so I believe it goes here. Here's the problem: (note: I will call any equivalent of real-world physical objects "...
6
votes
5answers
341 views

design for interruptable operations

I couldn't find a better topic but here it is; 1) When user clicks a button, code starts t work, 2) When another button is clicked, it would stop doing whatever it does and start to run the second ...
5
votes
1answer
13k views

Android Development: MVC vs MVVM [duplicate]

Possible Duplicate: Is Model-View-Presenter (MVP) scheme useful for Android? I've started coding for Android and I'm having difficulty trying to properly partition my code. I always end up ...
1
vote
2answers
93 views

Mingling DB transactions and logging from a design perspective

Say we have a view page where users perform actions in multiple steps, some of these actions would involve DB operations with transactions (the snippets are in pseudo-code like from): View 1: ...
0
votes
2answers
1k views

Designing a Web Application with Two Different Backend Databases [closed]

I'm working on a pretty standard LAMP based web application. The server itself has a standard MySQL database and the application is written in PHP. The kicker is, we also use SQL Server databases ...
5
votes
4answers
309 views

What pattern should one use to dynamically add multiple small views to one big main view?

Imagine a small calculator GUI, with basic operations (+,-,/,*), and in the menu we can check for example scientific calculator and a small new view with the extra functions appears beside. I was ...
3
votes
3answers
1k views

iOS - Unit tests for KVO/delegate codes

I am going to design a MVC pattern. It could be either designed as a delegate pattern, or a Key-Value-Observing(KVO), to notify the controller about changing models. The project requires certain ...
8
votes
1answer
563 views

Domain Model and Querying

I am new to DDD, having worked only in Transaction-Script apps with an anemic model, or just Big Balls of Mud, so please forgive any terminology I abuse. I am trying to understand the proper ...
5
votes
3answers
2k views

How to create a manager class without global variables nor singletons?

I would like to implement some kind of manager class in my application. It will be in charge of loading textures, processing them, distributing them etc... At first, I wanted to make a global ...
2
votes
2answers
3k views

IoC containers and service locator pattern

I am trying to get an understanding of Inversion of Control and the dos and donts of this. Of all the articles I read, there is one by Mark Seemann (which is widely linked to in SO) which strongly ...
2
votes
2answers
618 views

Pattern for loading and handling resources

Many times there is the need to load external resources into the program, may they be graphics, audio samples or text strings. Is there a patten for handling the loading and the handling of such ...
0
votes
2answers
1k views

What's the point of the Prototype design pattern?

So I'm learning about design patterns in school. Many of them are silly little ideas, but nevertheless solve some recurring problems(singleton, adapters, asynchronous polling, ect). But today I was ...
4
votes
2answers
1k views

What patterns book for iOS development contains this specific information? [closed]

I've read several books on iOS development and Objective-C, however what a lot of them teach is how to work with interfaces and all contain the model inside the view controller, i.e. a ...
3
votes
4answers
517 views

Representing complex object dependencies

I have several classes with a reasonably complex (but acyclic) dependency graph. All the dependencies are of the form: class X instance contains an attribute of class Y. All such attributes are set ...
4
votes
1answer
123 views

Design pattern for isomorphic trees

I want to create a data structure to work with isomorphic tree. I don't search for a "algorithms" or methods to check if two or more trees are isomorphic each other. Just to create various trees with ...
1
vote
1answer
311 views

Is there a good design pattern for this messaging class?

Is there a good design pattern for this? I want to create a messaging class. The class will be passed: the type of message (eg. signup, signup confirmation, password reminder etc) the client's id ...
1
vote
1answer
143 views

Am I missing a pattern?

I have a class that is a singleton and off of the singleton are properties that hold the instances of all the performance counters in my application. public interface IPerformanceCounters { ...
3
votes
2answers
5k views

Using PDO with MVC

I asked this question at stackoverflow and received no response (closed as duplicate with no answer). I'm experimenting with OOP and I have the following basic MVC layout: class Model { // do ...
3
votes
2answers
678 views

Design backward and forward button operations of a browser

If you were asked to design the backward and forward button operation (as a library) in a browser, how would you do it? What will be your APIs and parameters to them? what data structure will be best ...
4
votes
2answers
845 views

Is there a design pattern for chained observers?

Several times, I've found myself in a situation where I want to add functionality to an existing Observer-Observable relationship. For example, let's say I have an Observable class called PriceFeed,...
2
votes
1answer
2k views

Should I implement BackBone.js into my ASP.NET WebForms applications?

Background I'm trying to improve my group's current web app development pattern. Our current pattern is something we came up with while trying to rich web apps on top of ASP.NET WebForms (none of us ...
7
votes
2answers
10k views

Creating a Predicate Builder extension method

I have a Kendo UI Grid that I am currently allowing filtering on multiple columns. I am wondering if there is a an alternative approach removing the outer switch statement? Basically I want to able ...
1
vote
1answer
2k views

Class Design and Structure Online Web Store

I hope I have asked this in the right forum. Basically, we're designing an Online Store and I am designing the class structure for ordering a product and want some clarification on what I have so far:...
2
votes
2answers
335 views

What are the caveats of the event system built on Messenger rather than on classic .NET events?

MVVM Light and PRISM offer messenger to implement event system. the approximate interface looks like the following one: interface Messanger { void Subscribe<TMessageParam>(Action<...
5
votes
1answer
709 views

Abstract Factory Method and Polymorphism

Being a PHP programmer for the last couple of years, I'm just starting to get into advanced programming styles and using polymorphic patterns. I was watching a video on polymorphism the other day, and ...
5
votes
6answers
576 views

.NET - refactoring code

I have inherited and now further develop a large application consisting of an ASP.NET application, VB6 and VB.NET application. The software was poorly written. I am trying to refactor the code as I ...
5
votes
2answers
1k views

Designing web-based plugin systems correctly so they don't waste as many resources?

Many CMS systems which rely on third parties for much of their code often build "plugin" or "hooks" systems to make it easy for developers to modify the codebase's actions without editing the core ...
0
votes
2answers
349 views

Are monolith and microkernel design patterns or strategies?

What's the difference between a design pattern and a strategy? Is the monolith actually an anti-pattern?
1
vote
1answer
2k views

Use decorator and factory together to extend objects?

I'm new to OOP and design pattern. I've a simple app that handles the generation of Tables, Columns (that belong to Table), Rows (that belong to Table and have Columns) and Values (that belong to ...
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 (...
2
votes
4answers
4k views

Should I use the factory design pattern for every class?

I've been writing a website in PHP. As the code becomes more complex, I keep finding problems that can be solved using the factory design pattern. For example: I've a got a class Page which has ...
2
votes
2answers
300 views

doing a full permutation search and replace on a string

I'm writing an app that does something like a custom number (license) plate generator tool where if I ask for the plate "robin" it will suggest I try: r0bin rob1n r0b1n Are there any published ...