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
14 views

Modeling Associations

I am working on the design phase of a paper folding project. I have a few queries in this. Part of the problem statement says " A web can contain one or more ribbons in it. It can also contain a ...
2
votes
1answer
183 views

Good practice for returns in Python

I was recently working on some prototype code in Python. The code worked great, then I realized that I needed a little more feedback from one of my functions so I changed the return statement from ...
0
votes
1answer
76 views

Pattern that prevents events to trigger themselves

I am working at the client-side part of a web application, that is responsible for getting answers from users for specific questions and storing and restoring them from the database (or cookies) and I ...
0
votes
0answers
45 views

High-level Software Architecture Patterns [on hold]

Based on Big Ball of Mud, where the Pipeline pattern is mentioned, I'd like to know what other high-level patterns/architectures are there (besides modular and layered architectures). I'm mainly ...
1
vote
2answers
220 views

Is this a candidate for Singleton?

I have an external thermometer connected via USB that is controlled by my SW. Different parts of my system will use it but never at the same time (all in one thread). However, it is a single device ...
1
vote
1answer
167 views

When to use the whiteboard pattern versus direct calling

I'm creating the architecture for a new embedded project. The system has some inputs that go to wildly different outputs. The whiteboard pattern is very useful for this (see Listeners Considered ...
1
vote
1answer
38 views

Queue of jobs in a different states and with different services around

I need to design a 'queue' of jobs (in a a very much UI oriented application) that can be run by a user and I need some other thoughts to pick optimal approach from ground up. My jobs can be in a ...
0
votes
2answers
68 views

API - How to handle scope based functionality?

TLDR; Where and possibly how should I implement scope based logic in the example code? I have got a ASP.NET Web Api. The Api uses OData (on top off REST) for data endpoints and OAuth 2.0 ...
0
votes
0answers
70 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 ...
1
vote
0answers
59 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 ...
0
votes
0answers
24 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
1answer
109 views

What is design pattern/paradigm for ASP.NET web-apps? [on hold]

I don't actually know if my question is correct, but working on a webapp porting from ASP.NET world to Java + Spring platform I came up with this question in mind. Using Spring MVC, the new version ...
-3
votes
0answers
84 views

C# Implementing filtered Iterator without using yield return [migrated]

I'm trying to display elements of a list with filter and without filter. Here, I use the filter in such a way to display the elements which are divisible by 3. I'm going to use Enumerable and ...
0
votes
1answer
94 views

Observing progress of a distributed system

For a distributed system, there is a requirement of observing the progress of smaller applications on distributed computers (runtime 5 - 20 minutes). There is a web fronted, which right now only ...
1
vote
2answers
98 views

Should an abstract class always abstract its methods to an interface?

I had learned sometime ago that abstract classes should always abstract their functions to an interface. So instead of having something like this - abstract class a{ public int i; public int ...
1
vote
3answers
306 views

Passing data between hundreds of objects in java [on hold]

Currently, I'm working with a group on building a model. This model simulates interactions between many "agents" in a region. Agents can be any entity such as a city, a farmer, a business etc. Each ...
3
votes
0answers
40 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 ...
0
votes
2answers
206 views

Is there a design pattern for dynamically applying transformations or filters to a model?

For example, there is a model of an event with certain attributes that can be adjusted by existing processes: maybe one that looks at a geo-location stamp and determines a nearby city; another that ...
2
votes
1answer
47 views

ASP.NET MVC - Dynamic Views with many similar controls

I have a main View which has several sections and a main dropdown at the top which defines how the rest of the view looks like. All these sections have some data that is visible all the time, and some ...
0
votes
1answer
124 views

Onion Architecture Structure

I am looking to understand and implement the Onion Architecture and have a vague idea on how to structure everything but need help to clear up some of my confusion. Based on different examples and ...
2
votes
2answers
178 views

Best patterns for variable-scope disposables

I have Client which uses a disposable Connection for talking to a remote service. A Connection is somewhat expensive to set up and needs to be Dispose()d properly. I want to allow multiple methods ...
3
votes
4answers
167 views

How to identify and run the most relevant automated tests?

Suppose you have a reasonably large codebase (0.5 - 1 msloc) with a large test-suite (6-7hr single-threaded runtime; with a mix of unit-tests and integration-tests built with different tools). You ...
31
votes
9answers
4k views

Should we avoid using design patterns in constantly changing projects?

A friend of mine is working for a small company on a project every developer would hate: he's pressured to release as quickly as possible, he's the only one who seem to care about technical debt, the ...
0
votes
1answer
87 views

What design pattern should I use for import, update, export

I need to create a simple payments validator. On the following class diagram, I tried to present the model of payments. As you can see, each payment type inherits from Payments class. Now I want ...
1
vote
2answers
127 views

Sanity check for design pattern used with an intricate calculation model

I am working on a project that generates technical brochures in batch. The 3rd party API that is being used expects POCOs with property names that match field names used in each of the brochure ...
3
votes
1answer
744 views

does this model-pattern have a name?

A few years back, I wrote this answer to a question from which the following idea emerged. I call these "Type Descriptors", as I have never been able to find this pattern documented or formally ...
3
votes
1answer
295 views

Is there a term for this coding practice?

One of the incidental complexities of introducing features to an existing system is that the programmer often has to touch several areas of code that are not immediately adjacent. Over the long haul ...
2
votes
4answers
139 views

Subclass only have methods without variables

Is it ok to have subclass which does not declare its own variables (instance variables) and inherits from super class or base class? It has methods and there are some common methods which it overides ...
2
votes
1answer
143 views

Builder pattern inside interface. Bad design decision?

I am having trouble evaluating an implementation of the builder pattern I just came up with. The context is an API library, so I am trying not to expose any implementations in order to have a stable ...
0
votes
1answer
73 views

software design for client/server, over sockets, with JDBC [closed]

What's a reasonable architecture and design for a client/server application, over sockets, using JDBC? Right now I have the server query the database and instantiate a Queue of records. Clients may ...
0
votes
1answer
65 views

Where and how to reference composite MVP components?

I am learning about the MVP (Model-View-Presenter) Passive View flavour of MVC. I intend to expose events from view interfaces rather than using the observer pattern to remove explicit coupling with ...
0
votes
1answer
165 views

Is testability and mockability really that important in web development?

I'm reading this series on Laravel, and it's in great depth dealing with making everything testable, using Repository instead of just using the Models, using Dependency Injection and other obscure ...
0
votes
2answers
118 views

Is there a better way to load objects?

I have always kept the code to load an object within the object itself. That way no matter what method is creating the object, it always has access to the method to load the object. However this does ...
2
votes
1answer
131 views

Choosing between the view and the controller for my code

I'm aware there are a lot of topics about MVC design but it's hard to find good explanations: what I should do, what are the consequences of the different possibilities... So I'm working on an ASP ...
4
votes
5answers
1k views

Is this a good practice or not?

I have a colleague who has come up with a way of 'genericizing' information from a database so that all his web application's drop-down lists can share the same object in his MVC.NET C# code and ...
2
votes
2answers
75 views

subclass reference to another subclass

Imagine I have the following code: class A: pass class B(A): pass class C(A): def __init__(self): self.b = B() Is the above code correct in terms of correct inheritance? I ...
2
votes
1answer
87 views

What is a good strategy to develop apps that run in console and as API?

I develop quite often scripts that are primary used as a console application but later they are used in other scripts, webservices and other things where it is very convenient, to just import the ...
1
vote
5answers
199 views

Coupling business logic with class definitions

Perhaps it is my scripting background, but my perspective is that the purpose of an object should be to contain data. Classes are necessary in that they provide templates and standard ways to classify ...
4
votes
3answers
490 views

What is a helper? Is it a design pattern? Is it an algorithm? [closed]

Maybe a little tongue-in-cheek, but as I can't find this answer anywhere through Google, so to ensure Programmers Stackexchange has the answer: What is a helper? I see the name being used everywhere ...
2
votes
2answers
249 views

Repository pattern implementation that knows nothing about the database table and column names

I've seen around the Internet and Github, implementations for the design pattern Repository that knows about database table and column names. I was think, if I want to work with the database as a ...
0
votes
1answer
101 views

Confused on how to properly employ a Repository Pattern with Service/Business Layer on top

I'm building a ASP.NET Web Api 2 solution for learning purposes, and I've hit a snag. I was wondering if anyone could tell me what exactly it is that I'm missing. My Web Api solution has 4 Layers: ...
1
vote
1answer
59 views

Adding new functionality to all of shelve.Shelf's subclasses in Python

In order to avoid the overhead associated with the shelve module's writeback option I'm interested in putting together a shelf class that only accepts hashable values, with hashability being a proxy ...
4
votes
3answers
80 views

Returning results of method on batch list?

The title is a bit vague so I'll try to elaborate. I have a function makeFoo(int bar) -> returns Foo or throws Exception. I also have a batch version of this makeFoos(int[] bars) -> ...
1
vote
1answer
93 views

Freeing Memory: Observer Pattern?

I am building a scientific application in matlab which handles several hundred large matrices (large as in 'very few of these will fit into ram'). Each matrix is contained within a dedicated object to ...
1
vote
0answers
133 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
1answer
79 views

Implement Generic DataSet Builder with C#

I want to create a data access library that can build a DataSets with relations which can easily be written to XML with dataset.WriteXML(). This is a get to know C# endeavor that will hopefully gain ...
1
vote
1answer
123 views

How to design extension mechanism for java app

I have an application where I have a set of core features. The application itself HAS to work in core only mode. I would also want to make the application extensible such that, when certain ...
0
votes
2answers
87 views

Select design pattern - user stage

I'm struggling to point a finger into the right design pattern. I have a web site which user can register and interact with the system. I want to add the following abilities to a user: Each user ...
0
votes
0answers
8 views

Select design pattern - user stage [duplicate]

I'm struggling to point a finger into the right design pattern. I have a web site which user can register and interact with the system. I want to add the following abilities to a user: Each user ...
0
votes
1answer
22 views

Store Arbitrary values related to mysql record

I have created an app that manages a Data cleansing workflow. Each row imported needs to store an arbitrary number of key value pairs in addition to our standard mysql schema. The key values need to ...