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

learn more… | top users | synonyms (1)

3
votes
0answers
57 views

Mapping multiple differing taxonomies to each other

At work we have a varied number of websites selling second-hand products. The bosses have noticed that there's often some overlap between the products sold on some of the websites and would like to ...
2
votes
0answers
345 views

Fluent interface implementation and reflection. Case study

I hope I picked the right group for this question... I have this little framework I want to implement and I would like to have an opinion on it. In particular I am more concerned about the ...
1
vote
0answers
82 views

Why should ViewModel route actions to Controller when using the MVCVM pattern?

When reading examples across the Internet (including the MSDN reference) I have found that code examples are all doing the following type of thing: public class FooViewModel : BaseViewModel { ...
1
vote
0answers
58 views

Dealing with class optional dependencies

I am wondering how are you guys handling an optional class properties. Let's say I have a product that can bud doesn't have to have a color property. Is that really the best way of doing that? Should ...
1
vote
0answers
112 views

Menu building pattern

I'm having troubles getting my head around the active-state handling of a menu when the menu isn't used for routing. I come from Drupal where the menu system handles the routing as well. so setting ...
1
vote
0answers
88 views

Which patterns/architecture to apply for “Import Data, Process Data, Export Result”

I was wondering which architecture/patterns to choose for the following problem divided into three steps: Import TestScript Description from File (e.g. .xls, .txt) Process Described TestScript ...
1
vote
0answers
63 views

Pattern for data types that are related yet fundamentally different in utility

Background I'm currently working on a codebase for what is to become a forthcoming website's content "engine", where it will take in different types of standardized data (implemented with XML), parse ...
1
vote
0answers
181 views

MVC content management framework with an admin panel

I've lately been developing my own MVC content management system using PHP and, at least in my mind, am a little stuck with the system design. I believe this would apply to building a content ...
1
vote
0answers
33 views

How do I differentiate between old and new data in backbone collections?

A common pattern I come across is a backbone collection which is initially seeded from a database. However, the user can also add to the collection. When the user does add to the collection, these ...
1
vote
0answers
75 views

Processing a list of atomic operations, allowing for interruptions

I'm looking for a design pattern that addresses the following situation: There exists a list of tasks that must be processed. Tasks may be added at any time. Each task is wholly independent from all ...
1
vote
0answers
85 views

Methods for structuring JavaScript SDKs

I've built a REST API and have been using Backbone models throughout a couple different applications to communicate to it. I would really like to build a single JS SDK that can be used in any ...
1
vote
0answers
26 views

PaypalCheckout object is composed of PaypalQuery objects. Hide PaypalQuery objects to users of PaypalCheckout?

I have a PaypalCheckout object that handles the checkout process: from initiating API calls, to providing an interface for front-end code (e.g. View/Controller). The PaypalCheckout object handles: ...
1
vote
0answers
102 views

Run a function when a function in a list is executed?

Goal: I'm currently doing an MVC project and I have this method to update the ViewBag (based on previous actions of the user). I would like to call this function whenever a certain list of MVC Actions ...
1
vote
0answers
79 views

Creating classes according to a struct

I get a array via SOAP service, in the array in each value which is a struct is a description of any visual components (size, position, default value etc.) like CheckBox, RadioButton etc. And I wonder ...
1
vote
0answers
168 views

Which are the best ways to organize view hierarchies in GUI interfaces?

I'm currently trying to figure out the best techniques for organizing GUI view hierarchies, that is dividing a window into several panels which are in turn divided into other components. I've given a ...
1
vote
0answers
176 views

How should Object Model wrapper classes behave when underlying objects are deleted?

I'm currently building an object model library for use in a project. It wraps our internal concepts - Servers, Folders, Items - in an object hierarchy (IFolder, IItem, etc), and we have several ...
0
votes
0answers
17 views

Pitfalls of combining dependant traits and exceptions in same file as interface in php

What are the potential pitfalls of combining related class like objects (interfaces, traits, custom exceptions) in the same source file? For code reuse and only loading what I need I always separate ...
0
votes
0answers
42 views

Extending database model of ORM in subproject

I have a maven project which contains some entities which are stored in a database. The purpose of this project is to manage personal information, users, locations, etc. This project can work on its ...
0
votes
0answers
79 views

What is a good way to structure my UI classes?

So, I have a program which has a swing GUI. (Java - duh!) I really, really don't think the way I'm structuring my classes now is good, so I am reorganizing from the ground up to follow best practices. ...
0
votes
0answers
44 views

How to validate information on server without using database or session

Each user has multiple sites they can access reporting data for in an application I am working on. To prevent having to go to the database on every single request, I validate that they have access to ...
0
votes
0answers
26 views

Passing configuration to a handler

I'm building my own JET Parser and one of the things I am trying to do as per the JET specifications is to allow changing of the start and end tags from the default <% and %>. Right now I have ...
0
votes
0answers
92 views

When to use packages or Repositories in Laravel?

I'm a Laravel (PHP) developer, and new with DI, Packages (workbench) and Repositories (Pattern). I want to know about the best concept/methodology for a more flexible design; ie. the project can grow ...
0
votes
0answers
39 views

Encapsulate multiple properties into a single class to use as a custom DependencyProperty

My application is a WPF project implemented in C# .NET (4.5) using an MVVM architecture with no code-behind in the View. In order to eliminate the coupling between the View and the ViewModel I'm ...
0
votes
0answers
28 views

API providing function to be run in a thread vs. thread that runs this function

I'm writing a Python library which exposes a certain event listener interface. The user can register callbacks to handle different types of events. There is also a function which handles the actual ...
0
votes
0answers
30 views

update methods in simple factories

I have simple factory class with differently named methods which create the same object but differently. These created objects are persisted to db. These are then retrieved from the db elsewhere and ...
0
votes
0answers
54 views

How to cleanly write a multi step process with user feedback and multiple callback

When you have some process that has several steps and you multiple entry points the code gets ugly pretty fast. I encountered this with Facebook integration in my mobile app: User wants to share ...
0
votes
0answers
93 views

Android From Local DB (DAO) to Server sync (JSON) - Design issue

I sync data between my local DB and a Server. I'm looking for the cleanest way to modelise all of this. I have a com.something.db package That contains a Data Helper and couple of DAO classes that ...
0
votes
0answers
41 views

What should a domain object's validation cover?

I'm trying to figure out how to do validation of domain objects that need external resources, such as data mappers/dao Firstly here's my code class User { const INVALID_ID = 1; const ...
0
votes
0answers
65 views

does class reference itself static anti pattern in prism

I have an application and my desing approach look like this: class Manager { public int State; static Manager _instance = null; public static Manager Instance { get { return ...
0
votes
0answers
196 views

What's the best way to expose a Model object in a ViewModel?

In a WPF MVVM application, I exposed my model object into my viewModel by creating an instance of Model class (which cause dependency) into ViewModel. Instead of creating separate VM properties, I ...
0
votes
0answers
72 views

NCurses, scrolling of multiline items, “current item” pointer and “selected items”

I am looking for hints/ideas for the best (most effective) way on how to scroll multi-line items as well as emphasizing of the "current item" and "selected items" such as: 1 FOO ITEM 1 Foo sub-item ...
0
votes
0answers
77 views

Is this considered an implementation of the Template Method design pattern?

Please consider a StringBank class. This class holds a list of Strings and can return them to the client. It's code (irrelevant stuff omitted): abstract class StringBank{ List<String> ...
0
votes
0answers
35 views

Organizing an image processing pipeline for on-the-fly video analysis

I'm trying to design a system that performs image analysis on video streams from the internet. I have a few rudimentary ideas for how to organize such a system, and I was hoping you guys could ...
0
votes
0answers
60 views

Build a map with city blocks and road

Is there a design pattern or well known algorithm to build a simple map with roads and city blocks? To have an idea of what's my target i describe some of the constraints and the context: a matrix ...
0
votes
0answers
58 views

RESTful composition/inclusion of other resources

I have a few HTTP resources, and i'm wondering if including the models of one in the other is acceptable or if there is a cleaner method. In this example, we have a ton of "news" resources, and users ...
0
votes
0answers
51 views

Modelling network and persistent entity representations

I have an app where I need to synchronize some entities (simply download latest versions of entities from server to client). Entity has bunch of text properties and bunch of resource links (referenced ...
0
votes
0answers
119 views

How to design modular “screen configurator” for database application

I am currently working with a product that is effectively a glorified CRUD application. (It is a C# .NET 4.0 desktop application backed by an Oracle 11gR2 database.) The client program presents a list ...
0
votes
0answers
70 views

Looking for design pattern to represent shared state in music sequencer

I like to give lots of context, but also to state the basic question up top as concisely as possible. Feel free to read a little or a lot. I'm working on a music sequencer, and have been happy so far ...
0
votes
0answers
21 views

Composite repository with plugins for multitenant app

Im working on an app that has flexible storage configuration. For example: public class Repo1:IRepository { public void DoSomething(int tenantId, string someKey) { ... } } This ...
0
votes
0answers
74 views

Difference between class clusters and abstract factory in cocoa

I have read that Obj-C class clusters are an implementation of the abstract factory. Can anyone explain if there are any differences between the 2 as design patterns. I read somewhere that there are ...
0
votes
0answers
29 views

DSL enabling users to reference forms and records to display?

There are three main "unique" components to my system: Visual form builder (AngularJS backed); generates an id CRUD automatically available for it at /form_type/id "Aggregate page"; with a form ...
0
votes
0answers
47 views

Putting together Data Mappers and Domain Objects inheritance

Currently, I have a system with a Data Mapper and multiple Domain Objects which inherit from the same class, let's say B and C that inherit from abstract class A. In order to retrieve data, I need to ...
0
votes
0answers
221 views

Javascript design pattern with jQuery Widget factory

I am using the jQuery widget framework for creating some graphical elements on a webpage, and I have a conseptual question about the overall structure of the code. I have 3 classes A, B and C which ...
0
votes
0answers
175 views

Should you implement a repository pattern with an MVVM javascript framework?

When coding a MVVM pattern I use Dependency Injection (DI) and try and code against interfaces. One of the common patterns is a Repository pattern, so I can swap my data storage provider. If I'm ...
0
votes
0answers
86 views

Design of a custom query result array with lazy loading

I have a database that generates a query result array, each position of the array being a hash like object. Since each array item must be mapped into a well defined class, I decided to implement an ...
0
votes
0answers
262 views

Which interface allows you to use a design pattern that is characteristically changed with the instantiation of objects?

I am doing a research on this and can't find my answer to this question: Which interface allows you to use a design pattern that is characteristically changed with the instantiation of objects? ...
0
votes
0answers
49 views

Abstracting complexity of transactional key value store

Our application stores settings in the platform's "transactional key-value store". prefs.edit().putInt("a", 1).commit(); int a = prefs.getInt("a"); I'd like to refactor our code for the following ...
0
votes
0answers
200 views

Is Pure Fabrication (GRASP) only about 'behaviour' , is it the 'representational gap', or is it about actual 'reality'?

Does Pure Fabrication refer to the increased representational gap only in terms of behavioural responsibilities i.e. the software classes added to the domain model to handle ONLY behaviour, or does it ...
0
votes
0answers
51 views

Separating Db from business with Inherited classes using multiple views

I have a software that has a car model that will be used in different views (listing, ads, detail page, carousel, up sell widget,etc). class CarModel extends DbModel{ } I look for a "nice way" (a ...
0
votes
0answers
128 views

Algorithms or patterns for a linked question and answer cost calculator

I've been asked to build an online calculator in PHP (and the Laravel framework). It will take the answers to a series of questions to estimate the cost of a home extension. For example, a couple of ...