Tagged Questions
2
votes
1answer
71 views
design strategy pattern with null checking
When the context class can accept a null strategy, is there another way to do it without check if its null?
Is this considered a good strategy design implementation?
class MainApp{
static void ...
8
votes
3answers
401 views
Refactoring an existing abstract class and its parameters
I have an abstract class A which declares an abstract method doStuff. Currently there are many classes that inherit from A and implement doStuff.
The class' instances are initialized at run-time ...
4
votes
1answer
109 views
Creating an entity relationship in REST: May I create the parent by posting to a child id?
We are currently designing a REST API to access classical customer data.
One of the elements in the API are the assets of an user. The assets are added under a given service. The backend API will ...
-1
votes
3answers
60 views
Best way to create draw with limitation
I'm writing a program to automatically make the draw for a competition. There are four objects: Debate Judge School Team Each Debate has two teams and a judge. Each team participates in three debates. ...
2
votes
5answers
243 views
Do tools, like Windows Workflow, inhibit development growth? [closed]
I’ve had this gut feeling about Windows Workflow (WW) for a while now. And, until now, I couldn’t think of the right words to say in order to explain it. Since I think I have a good way to verbalize ...
0
votes
1answer
131 views
Designing application flow
I am creating a web application in java where I need to mock the following flow.
When user trigger a certain process (add product to cart), I need to pass through following steps
Need to see in ...
5
votes
3answers
234 views
Writing your own framework or using an existing one? [duplicate]
I know there are similar questions to this one, and I've read most of them. Most of the answers to these questions are talking about "cost-effectiveness" and "time-saving" aspects of the frameworks, ...
1
vote
1answer
125 views
Multi-user Configuration Settings design
I am designing a flexible and extensible way to store configuration settings for users.
Database Table Design:
╔═════════════════════════════╗
║ ConfigurationItemDefinition ║
...
2
votes
3answers
166 views
Factory Method: does the Product have to be a different class than the Creator?
I want to build three sites in PHP. I'm doing this as slowly, thoughtfully and carefully as I can, to learn as much about things like OOP and software architecture as possible.
From past experience I ...
13
votes
6answers
620 views
Map of functions vs switch statement
I'm working on a project that processes requests, and there are two components to the request: the command and the parameters. The handler for each command is very simple (< 10 lines, often < ...
3
votes
1answer
153 views
Application Design with a Shared Database
I have a generic design question that relates to enterprise applications but I think that software developers from other types of projects may have experience with this as well.
The scenario is ...
0
votes
1answer
77 views
Online stores service design
I am designing an online store service app with rails. Everyone who wants to make his/her own store can do it with this app by just signing up and choosing a domain. I want to make it as SaaS as it ...
0
votes
1answer
37 views
Program Structure for Table Cells Representing Objects
So I have a program with "cue" objects and each have their own table cell. The thing is that the table cells have loading bars on them that represent the progress of the cues. This presents the ...
0
votes
1answer
91 views
What is a good design for a container, assignment and items
------------- 1 * -------------- * 1 --------
| Container |--------| Assignment |-----------| User |
------------- -------------- --------
^ ...
2
votes
2answers
227 views
How to use MVC in practice
I'm very confused. I can't even begin to understand how MVC would be implemented outside of web development. This might seem like too general a question, but how would one apply MVC. I have the ...
2
votes
3answers
166 views
Using a database for each module in a system [duplicate]
I was reading this question:
I was trying to standardize and modularize some functions (Email
Management Module, CMS Module & etc) by implementing a 3-tier
architecture concept where each ...
-5
votes
1answer
178 views
Singleton: Is Singleton Pattern Evil/Stupid [duplicate]
Was reading an interesting blog post on Singleton design pattern which is so widely used.
If it's stupid or as in some quora posts, its an anti-pattern why is it so widely used even in frameworks.
...
9
votes
4answers
396 views
Command pattern design
I have this old implementation of the Command pattern. It is kind of passing a Context through all the DIOperation implementation, but I realized later on, in the process of learning and learning ...
4
votes
2answers
163 views
Designing a function with many optional components
I'm trying to figure out a good practice for designing a function with (many) optional components.
For a specific example, say I am interested in designing a feature extractor function that takes as ...
4
votes
2answers
228 views
Preventing Liskov Substitution violation
I am reimplementing some component and noticed that the original version has a Liskov Substitution violation. It's not all that critical, though I'd like to get rid of it in the new implementation . ...
4
votes
3answers
190 views
Using the mouse as a multi-tool creates heavy conditional logic for executing commands, how do I change this?
The feature is in many different types of editing programs where a mouse click may have completely different commands to execute (using the Command Pattern)
Currently I have an overarching ...
3
votes
7answers
294 views
Are design principles important, and if so, why don't more people use them? [closed]
I am a developer who works for an in-house information communications technology (ICT) department.
I am usually quite critical when looking over code that I have not written as I find time and time ...
7
votes
3answers
663 views
What is the principle of least astonishment?
In programming what is called Principle of Least Astonishment? How is this concept related to designing good APIs? Is this something applicable to only object oriented programming or does it permeate ...
4
votes
2answers
412 views
A design pattern for data binding an object (with subclasses) to asp.net user control
I have an abstract class called Address and I am deriving three classes ; HomeAddress, Work Address, NextOfKin address.
My idea is to bind this to a usercontrol and based on the type of Address it ...
8
votes
3answers
625 views
How to avoid “managers” in my code
I'm currently re-designing my Entity System, for C++, and I have a lot of Managers. In my design, I have these classes, in order to tie my library together. I've heard a lot of bad things when it ...
6
votes
4answers
274 views
Applying DRY to an inheritance hierarchy
I'm working on refactoring a legacy application where I implemented the State pattern successfully as shown in the following diagram:
As you see there is a common behavior between the 3 states, so ...
1
vote
1answer
92 views
Possible Designs for code block editor
I have started a project where I need to design an application that will work as a code-block editor, much like lego mindstorms and this google project. http://code.google.com/p/blockly/
What are the ...
2
votes
1answer
117 views
In MVP, should presenters instantiate and control other presenters?
I've implemented an application using MVP with GWT, which is working out very nicely for views that have a single purpose. Now, it has evolved into views that are achieving multiple purposes in a ...
3
votes
4answers
197 views
Should we validate a state transition before attempting it in the State Pattern?
When applying the State Pattern illegal transitions should result in an exception being thrown (or at least that's what I understood from the pattern)
I know exceptions are for "unexpected behavior" ...
2
votes
1answer
145 views
Shift Javascript framework - What pattern is this? MVP, MVC or something else
I have created a very tiny framework to be able to get away from all the clutter while developing. The point of the framework is not to replace any library of choice but simply segregate the code to ...
3
votes
0answers
93 views
Bridge Design Pattern - I still don't get it [duplicate]
Possible Duplicate:
Understanding the bridge design pattern
I have read lots of material about the bridge design pattern:
...
2
votes
0answers
115 views
Gesture recognition and management paradigms [closed]
I had the occasion to play a little bit with severeal different multitouch or multi-input paradigm systems such as multitouch tablets,Kinect,Leap Motion...
Despite the diffrences between those ...
2
votes
3answers
135 views
Abstracting out a module or using the Module Singleton directly?
I am working on a module which is dependent on other module for some functionality. Now the dependent module provides a lot of functionality and I need only few of them, hence got the idea to create ...
-1
votes
2answers
197 views
How do you deal with age when a person has died in applications/reports? [closed]
This is a bit subjective but I'm dealing with a group of people and their dependents in a report. Many of the users have died many years ago, but their dependents still live on.
The report has their ...
0
votes
1answer
249 views
How to structure our Javascript so that it is easily editable, testable, and can make calls to render a view without knowing specifics about the view
I am working on a web app that displays some data and uses javascript.
Right now, we are serving up parts of our js (to display certain types of information, ie "Render a View") via our server which ...
5
votes
1answer
564 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
468 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 ...
7
votes
3answers
319 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 ...
4
votes
3answers
226 views
How to refactor “nested” view classes to avoid deep method calls?
Lets say I'm displaying a bunch of data (model) using a View class for rendering. However, a lot of the data has sub-data (models) complicated enough to require separate rendering classes.
In my ...
13
votes
3answers
525 views
Does the state Pattern violate Liskov Substitution Principle?
This image is taken from Applying Domain-Driven Design and Patterns: With Examples in C# and .NET
This is the class diagram for the State Pattern where a SalesOrder can have different states during ...
1
vote
1answer
108 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
0answers
198 views
Best Design Pattern for Coupling User Interface Components and Data Structures
I have a windows desktop application with a tree view. Due to lack of a sound data-binding solution for a tree view, I've implemented my own layer of abstraction on it to bind nodes to my own data ...
3
votes
1answer
95 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 ...
3
votes
4answers
232 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 ...
1
vote
2answers
210 views
What is a useful pattern to maintaining an object state in a one to many relationship?
I am looking for a design for my application, here are the players(classes) involved.
struct Transform {
// Uses a matrix to transform the position.
// Also acts acts as the state of a ...
2
votes
2answers
417 views
Alternative to “inheritance versus composition?” [duplicate]
Possible Duplicate:
Where does this concept of “favor composition over inheritance” come from?
I have colleagues at work who claim that "Inheritance is an anti-pattern" and want to use ...
2
votes
3answers
136 views
What is the best approach to solve a factory method problem which has to be an instance?
I have to add new funcionality in a web service legacy project and I'm thinking what is the best approach for a concrete situation.
The web service is simple: It receives a XML file, unmarshalling, ...
5
votes
2answers
252 views
Constant values in the interface
Some time ago I have read two different books and each of them gives totally different answer for the question if it is a good pattern to define constant values in the interface (in java).
So I am ...
4
votes
1answer
143 views
DDD: service contains two repository
Does it correct way to have two repository inside one service and will it be an application or domain service?
Suppose I have a Passenger object that should contains Passport (government id) object. ...
-2
votes
2answers
108 views
Design for a plugin based application [closed]
I am working on application, details of which I cannot discuss here. We have core framework and the rest is designed as plug in. In the core framework we have a domain object. This domain object is ...

