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

learn more… | top users | synonyms (1)

3
votes
1answer
68 views

Adding field to the class at runtime - design pattern

Imagine your customer want's to have a possibility to add new property (e.g. color) to product in their eshop in their CMS. Instead of having properties as fields: class Car extends Product { ...
3
votes
1answer
122 views

implementing dynamic query handler on historical data

EDIT : Refined question to focus on the core issue Context: I have historical data about property (house) sales collected from various sources in a centralized/cloud data source (assume info ...
1
vote
1answer
185 views

How to avoid duplication of code related to shared entities in the repository pattern?

I'm building a repository for a large CRM schema that has a high number of relations between entities. Some of the entities are referenced by almost all entities, e.g. Person and Company. Where I ...
1
vote
1answer
159 views

Create an Objective-C category to route methods depending on a specified type

For one project, I needed to find a solution to avoid code like this: if ([self.desiredColor isEqualToString:@"Red"]) [self constructRedMenu]; else if ([self.desiredColor ...
1
vote
1answer
241 views

Creating a System Sequence Diagram from an [extended] use case

As I have been taught - one controller = one use case. But I have: OutsiderController SupplierController (which extends OutsiderController) SubContractorController (which also extentds ...
0
votes
1answer
76 views

Design Pattern for Data Validation

What would be the best design pattern for this problem: I have an Object A. Object A can either be registered or deleted from the database depending on the user request. Data validation is performed ...
0
votes
1answer
41 views

System Communication: Avoiding Including a Large “HAS-A” Hierarchy Which Isn't Used

The situation: System A Huge, complicated system. Uses an important Message object with many other Message objects attached, many of which have further Message objects attached. In total, this is ...
0
votes
1answer
55 views

How to design a scriptable communication emulator?

Requirement: We need a tool that simulates a hardware device that communicates via RS232 or TCP/IP to allow us to test our main application which will communicate with the device. Current flow: ...
0
votes
1answer
67 views

Interface questions for using Command Pattern and Dependency Injection together

I have many projects that have essentially the same high level requirement: test all hardware on a device. Each device can have a different communication protocol, requires different test equipment to ...
0
votes
1answer
105 views

Whats an Ideal way to pass rules/options to methods that build SQL

We're trying to come up with a way to handle code that builds dynamic SQL for our application, which is very database centric. Things like Linq to SQL and Entity Framework are out of the question, so ...
0
votes
1answer
133 views

Email Content creation | Proper design

Working on an E commerce application where we need to send so many email to customer like Registration email Forget Password Order placed There are many other emails that can be sent, I already ...
0
votes
1answer
384 views

Is this a design pattern?

I have following C# code. It helped me to avoid some code repetition in a good way. The ExecuteQueryGenericApproach<T> method receives a Func generic delegate as argument. The delegated method ...
8
votes
0answers
614 views

Useful design patterns for working with FragmentManager on Android

When working with fragments, I have been using a class composed of static methods that define actions on fragments. For any given project, I might have a class called FragmentActions, which contains ...
4
votes
0answers
143 views

Loose Coupling Presenter to View in MVP

We work in a Java shop here and our web application uses an implementation of the MVP architectural pattern. Our manager comes from a .NET world, where he has been exposed to the MVVM design pattern. ...
3
votes
0answers
283 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 ...
3
votes
0answers
236 views

What is the good way of sharing specific data between ViewModels

We have IAppContext which is injected into ViewModel. This service contains shared data: global filters and other application wide properties. But there are cases when data is very specific. For ...
2
votes
0answers
44 views

Best approach for tracking dependent state

Let's pretend I work on a project tracking application. The application is a database backed, server hosted, web application. In this application there are Projects which have many Activities which ...
2
votes
0answers
227 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? ...
2
votes
0answers
371 views

Acceptable placement of the composition root using dependency injection and inversion of control containers

I've read in several sources including Mark Seemann's 'Ploeh' blog about how the appropriate placement of the composition root of an IoC container is as close as possible to the entry point of an ...
1
vote
0answers
46 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
108 views

Javascript Implementation Patterns for Server-side MVC Websites

I'm looking for information on common patterns for initializing and executing Javascript page by page in a "traditional" server-side MVC website architecture. A few months ago, my development team ...
1
vote
0answers
78 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
164 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 ...
1
vote
0answers
157 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
138 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 ...
1
vote
0answers
240 views

Android design advice - services & broadcast receivers

I'm in the process of learning the Android SDK and creating some projects to get a grasp on the system. The current project I'm working with works just fine but I'd like to get some advice about ...
0
votes
0answers
79 views

Help finding good design/architecture patterns for systems integration

There are several programs written at my company that to some level automatically configures systems. The systems that are configured by the programs can sometimes be the same but are most often not. ...
0
votes
0answers
89 views

Implementing a strategy pattern with dependency injection

Okay, so the goal here is to implement a strategy pattern that can be tested using any sort of automated testing tool. I've been struggling with this problem conceptually for a few weeks now and I ...
0
votes
0answers
42 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
49 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
18 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
155 views

Managing data within the Scalable JavaScript Application Architecture (Zakas)

I've been reading a lot about scalable JavaScript applications and found the architecture in this presentation by Nicholas Zakas quite amazing. However I had a few questions concerning data/models ...
0
votes
0answers
40 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
27 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
34 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
103 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
115 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
54 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
69 views

Are there any concerns with using a static read-only unit of work so that it behaves like a cache?

Related question: How do I cache data that rarely changes? I'm making an ASP.NET MVC4 application. On every request the security details about the user will need to be checked with the ...
0
votes
0answers
46 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
49 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
117 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 ...
0
votes
0answers
426 views

Syncing client and server CRUD operations using json and php

I'm working on some code to sync the state of models between client (being a javascript application) and server. Often I end up writing redundant code to track the client and server objects so I can ...
0
votes
0answers
77 views

Recaching calculations

I'm working on a webapp which has an existing framework to cache values from the database. I have a requirement which needs multiple values from the database and the values have to be ...
0
votes
0answers
62 views

What are the pros and cons of running multiple instances of an app per marketplace?

One app to rule them all, and in the darkness, bind them. I'm speccing out a client app at the moment. The same service is to be delivered to two separate counties and the the content within: users, ...
0
votes
0answers
147 views

Pattern or solution for using classes with different interface the same way

What I would like to achieve is to use classes (now two, later more) with different interface the same way, so I would like avoid using decisions based on the interface on upper levels for instance, I ...
0
votes
0answers
138 views

Do multiple 'helper' classes conflict with the accepted Apple design scheme?

I have a social location based application and I'm in a bit of design conflict that I can't seem to solve or find good information on. Realizing that I have multiple controllers that will similarly ...
0
votes
0answers
96 views

Using a Finite State Machine for access management?

My intranet site uses LDAP and Active Directory to authenticate users. There are 2 kinds of Users: Managers and Employees. They are differentiated by having membership in a particular AD group. In an ...
0
votes
0answers
48 views

Pattern for XPDL import

I am using xml serialization for importing/exporting data from/to xpdl format. And I need a little advice - to what pattern to use. Right now I have 1 huge class for controlling the whole process (it ...
0
votes
0answers
138 views

Build filter conditions for entities on client side

I have the requirement that users should be able to specify filter conditions for one kind of entity through a GUI on a thin client. These conditions must be convenient to generate, meaning the GUI ...