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

learn more… | top users | synonyms (1)

0
votes
0answers
28 views

Transaction Management in Hibernate with DAO Design Pattern

I have many Tables, For every Table,we have DAO Interface and DAOImplementation class. Example DAO Interface public interface CancelPolicyDAO { public CancelPolicy insertCancelPolicy(CancelPolicy ...
0
votes
0answers
26 views

What are some best practices concerning separation of concerns and transactions?

I believe I know the answer to this but I'm looking for any holes or anything I may be missing. This is focused on Spring and Java but could really apply to any programming stack. Anyway, we have a ...
0
votes
1answer
111 views

How to deal with product owner who refuses to follow UI design rules

We develop Android application. We base on old version of similar application developed in our company. This old application was designed by some noobs which didn't follow UI Android design rules. ...
0
votes
4answers
210 views

How to ensure objects unique by equality?

I frequently have this problem but didn't find it as an established programming pattern. I have some Class C whose equality is determined by some key k and I want to prevent time-consuming ...
2
votes
1answer
209 views

What is this pattern called? Run finally?

Is there a name for this pattern? I've written this kind of thing a few times in JavaScript and recently found myself writing it in C#. Thing is, I expect this has already been implemented in a ...
1
vote
1answer
44 views

Patterns for subclass constructors that vary the parent class constructor slightly

So, my problem is in the context of an MVC-style approach. The code here is PHP, but I'm hoping this is a design issue independent of it. abstract class Controller { private $domain; private ...
4
votes
6answers
713 views

What should an object be called that contains only setters and getters? [closed]

Suppose there's an object that contains only setters and getters: class Config { public void setName(String name) { this.name = name; } public String getName() { ...
12
votes
7answers
2k views

Name/Fix for Production Code Whose Sole Purpose is to Facilitate Testing? [duplicate]

The linked "duplicate" question is an iffy match at best, because it's asking is pattern X OK (YES/NO) and I'm clearly already in the NO camp, and subsequently asking what is pattern X called ...
0
votes
3answers
100 views

Communicating between unrelated components/objects

Imagine that I have a game, with Monsters, Missions, Vehicles, and of course their controllers and such, so a Monster class, Mission Controller class, Vehicle Controller class and so on. Suppose that ...
0
votes
1answer
59 views

Using entityManager/repository Class/session factory directly in controller

I wonder what is your approach on following subject: let's say we have MVC structure with entities, repositories, controllers and service layer. My approach to use above was pretty clear for me: ...
1
vote
0answers
58 views

Need to refactor file downloader and post processing utility [duplicate]

Not sure whether this is the right forum to ask this but here goes. Using this solution - http://stackoverflow.com/questions/26571351/replacing-if-else-logic-with-state-strategy-pattern I was able to ...
7
votes
1answer
167 views

Null Object Pattern and Input validation - copy real implementation or silently accept everything?

I have a WifiComponent in my Camera in my client application. It's responsible for handling the Wifi-related functionality of the Camera. The Camera represents a real world camera. This WifiComponent ...
1
vote
1answer
145 views

Should we use data object (or the data transfer object) for sharing data between these three classes?

I found an article by Martin Fowler that has made me doubt my design choices, particularly about data objects. Martin Fowler has written an article about what he thinks is a code smell. In this ...
0
votes
1answer
47 views

Control (avoid) changing fields with side-effects

I have been thinking about a design problem and possible solutions in my own. I am pretty sure I am not the first one to have noticed it, but I cannot google for it since I do not know the standard ...
0
votes
0answers
54 views

Generalization of phase based systems for card and board games

In an exercise of futility I'm trying to abstract and generalize a framework where to build any turn/rule based system. I've had a head start but after decompiling HearthStone I'm second-guessing that ...
0
votes
3answers
62 views

Client vs Creator in Factory Method and Abstract Factory patterns

This page descibes one important difference between Factory Method and Abstract Factory: http://architects.dzone.com/articles/factory-method-vs-abstract The difference, according to this page, is ...
21
votes
4answers
1k views

Why do code-bases in n-tier development have an equal amount of, if not more, JavaScript code now?

I've been doing web programming for a long time now, and somewhere, I lost track of why we are doing what we are doing today (or how did we come to do things this way)? I started out with basic ASP ...
1
vote
1answer
202 views

How do you keep control in a large software project? [duplicate]

I've a large-ish software project that I'm the sole developer for (~80KLOCS and counting - I know there are much larger projects out there, but it's an order of magnitude larger than I've ever had to ...
1
vote
1answer
43 views

Duplicate method in spring services, how to refactor?

ServiceOne.java private void doStuff(){} ServiceTwo.java private void doStuff() Where to put common code ? Shall I create a new service, but then what interface will it implement ? Or shall I ...
-5
votes
1answer
49 views

How best to design a SQL Parser in java, any prevailing design pattern comes to mind? [closed]

What software pattern is most useful for building a SQL Parser? I would like some ideas on how to even get started on something like this.
3
votes
1answer
73 views

Designing a better performing total permissions setup for multiple permission levels

We've got a global system that we are attempting to solve a permissions issue around. Currently, our system serves a number of different applications out to our clients and each client has their own ...
0
votes
0answers
37 views

Choosing a pattern for domain logic on top of ORM model

I am using Python and ORM, particular SQLAlchmey. I have an ORM model which implements data mapper pattern. The model has a field state, which can take one of several states, let's say NEW, CANCELLED, ...
1
vote
0answers
129 views

C# structure needed for dynamic behaviour

I am using Unity to build a visualisation of a serious game. I am using the C# programming language. My problem is that I receive data from a JSON and I parse it and I end up with a list of different ...
1
vote
0answers
100 views

Program Architecture: How to manage objects that are interdependent

Consider the following case, image I making a simple chat program; I want it to be extensible such that it would be fair easy to add add different scripting and user interfaces. I want the core ...
3
votes
2answers
188 views

How and Why should class modifiers enforce or prevent inheritance and the ability to override

This isn't really related to anything I am working on currently, its more of a question I really couldn't find an answer for. Class modifiers like MustInherit or NotOverridable to me, seem like they ...
0
votes
1answer
168 views

Is factory pattern a right pattern for the situation described here?

Is factory pattern a right pattern when we want to consolidate the related objects? Problem - In the Set-top box, I have a user-io, basically the interface to control the settop box - The user-io can ...
2
votes
1answer
125 views

Is the application architecture of Facebook Flux a new idea?

Facebook announced that it's using the architecture they call Flux to develop their projects. It consists of a single direction dataflow, and concepts like a Dispatcher, Stores and Actions (well ...
0
votes
1answer
36 views

Communication between Multiple Presenters in MVP

I'm designing an application using the MVP pattern, but a few of the edge cases for the system rely on communication between multiple presenters. View 1 calls Presenter 1 which does Operation A ...
0
votes
0answers
15 views

Determining proximity of entities based on multiple measures

I have a database table set up like so: Table: entities name - varchar score - int category - varchar value - int value2 - int depth - float ... etc. Example: name ...
0
votes
1answer
133 views

Good design pattern for linq to sql

I currently have a linq to sql project that was used for one project and not much work was put into it, only the generated context and entities were used. Since then the project has started to become ...
0
votes
2answers
192 views

Is performance the only reason not to use SignalR (websockets) entirely in lieu of a traditional REST API?

I have used SignalR to achieve real-time messaging functionality in several of my projects. It seems to work reliably and is very easy to learn to use. The temptation, at least for me, is to abandon ...
-1
votes
1answer
196 views

Is this a well known design pattern? [closed]

We have: class Entity { // ... }; There are many sub-classes of Entity - direct and indirect. Some of the sub-classes of Entity, such as Edge, Face, CoordinateSystem, Part, and Assembly, need ...
0
votes
0answers
19 views

passing different models to view based on razor theme engine

I'm using a pattern similar to the one here to implement a Themed View Engine. Basically instead of having a View folder, I have a Theme folder and inside different themes: default, red, blue, green, ...
0
votes
2answers
205 views

Why use Creational patterns in Java?

How are Creational patterns useful? Most of the material I came across explains the use case to "solve common problems associated with object creation, improve flexibility". I can think of just two ...
0
votes
1answer
43 views

Software to access GSM Terminal, sending and receiving AT commands, validating results

I am currently implementing a software that uses a GSM terminal to perform actions. Actions can be sending messages, checking balance, receiving status report messages, setting the pin, ... The ...
5
votes
3answers
294 views

What is a good design pattern for multi-mode software?

I will explain my question by way of example, but I'd love a general solution. I am writing a JavaScript application that needs to function differently depending on its run-time context. To handle ...
0
votes
1answer
68 views

How to compute data for charting?

I'm building a charting component that displays data directly from the raw data records. It should be able to filter data (subset) and then perform some rudimentry maths on the data (sum, avg, etc). ...
0
votes
0answers
22 views

Should you register other services in ViewModelLocator in MVVM light?

I'm new to MVVM Light and SimpleIoC. My question is, should all the registration of view models and other services be done in the ViewModelLocator class? Or should ViewModelLocator be used only for ...
0
votes
0answers
38 views

How to clean composition root from anything other than object construction?

I'm doing poor man's DI (manual injection) in my application. My (pseudo-) composition root looks something like this: var connectionSettings = new Settings(SqlParameters) var dataLoader = new ...
3
votes
2answers
239 views

How do you apply Single Responsibility principle to a repository

I am trying to apply "SOLID" whenever I can and try to use common sense and avoid a pattern when I see that a pattern is creating more problems than it's trying to solve. I don't want to apply a ...
13
votes
4answers
575 views

Proper Model-View-_____ design

I've been reading up about Model View Controller, Model View Presenter, Model View ViewModel, and so on, and generally, the underlying concept seems pretty simple to understand: keep the pretty ...
0
votes
0answers
25 views

What is the best way to initialize a child's reference to its parent? [duplicate]

I'm developing an object model that has lots of different parent/child classes. Each child object has a reference to its parent object. I can think of (and have tried) several ways to initialize the ...
-4
votes
1answer
92 views

Creating n tier application [closed]

I am new to design patterns. I want to learn constructing 3 tier architecture. I have searched but confused at some points. In this article ...
0
votes
1answer
107 views

IOC Between Presentation and Infrastructure Layer

Question: I would like to set forth dependency mapping from a *.config file from a project that has no reference to the project that contains the concrete class. Scenario: I'll be using terms from ...
0
votes
1answer
125 views

Object in Business layer same as DTO with logic?

Let's say I have a Spring MVC project, in which I'm using DTO to get data from a database and to pass data to the UI. Let's suppose that I have a UserDTO and in my business layer I have to do ...
1
vote
7answers
361 views

What is the simplest way to broadcast data from application to other applications in .Net

I want to send information from one .Net application to multiple other .Net applications. I want the applications to be loosely coupled. The number of applications receiving the information could ...
3
votes
3answers
214 views

Interface to enumerate over files

I'm trying to design a generic interface for enumerating over a list files. Each iteration will open a file, allow the consuming code to access the file to perform some task, and then close the file. ...
1
vote
0answers
86 views

Callback pattern handling exceptions - Best practices in .NET 3.5

I am looking to implement the callback pattern with error handling such that error is caught and pass to the callback code with the response. Since I am using .NET 3.5, I cant use Task (TAP) pattern ...
0
votes
1answer
127 views

How does the consumer-producer solution work?

I'm only a beginner, and my book doesn't cover this subject. I have researched my problem and found that an implementation of the consumer-producer pattern is the ideal solution, and have Googled it, ...
1
vote
1answer
201 views

Should I couple these classes?

I am programming in Python. I have several complicated/hard-to-understand XML files that describe the structure of an election. I am trying to write a python wrapper that makes it easy to access this ...