A design pattern is a general reusable solution to a commonly occurring problem in software design.
0
votes
1answer
39 views
Maintaing drop down lists for the application
What would be the best approach to maintain the dropdown lists for the whole application (like city, state etc) taking into account the SOLID principles and performance?
Right now am loading the list ...
-3
votes
0answers
88 views
Name of the software design pattern for the Twitter or Facebook style timeline [on hold]
Is there a name to describe the design pattern for the Facebook or Twitter style timeline? I mean the infinitely scrolling activity feed with messages, pictures and comments. Googling for answers, I ...
-3
votes
0answers
28 views
Software Engine definition [duplicate]
I just read the wiki for software engine.
Why is a certain software is called an engine. like search engine, storage engine, rule engine etc?
How does a software qualify to be called an engine?
Is ...
3
votes
2answers
243 views
Sending Exceptions as event arguments
Is it a good idea to send Exceptions as EventArgs in C#? (And not actually throw the Exception).
I have a class that performs a long running asynchronous task. If something goes wrong in the middle ...
0
votes
0answers
35 views
Pattern for object attribute plugability
I've got a requirement to represent a business object which is hugely customizable, and whose attributes are completely plug-able. The core class is very loosely defined, and has very few core ...
0
votes
0answers
32 views
OOP style class wrapper for bulk records?
Recently I've been tasked with building an application that synchronizes data between two databases.
I've created AccountingService class for the source database and a bunch or repository classes for ...
0
votes
0answers
14 views
Fill widget with data retrieved from internet
I want to retrieve data from internet and show them into a widget.
In particular, I've a widget with a QComboBox containing some service from which I can retrieve a list of exchange markets.
When I ...
-4
votes
2answers
75 views
What thought process is (or steps are) involved in the development of the code for an application? [on hold]
Please note, my question is definitive, and neither too broad nor opinion based. So please don't close. Even if you want to close this question, at least give an answer to the question in the ...
3
votes
1answer
59 views
Who is the Owner of Information? Memento vs. Originator
Imagine for a second that I'm implementing the Memento Pattern, using the following classes.
Classes
An Originator class that has public and private, properties and fields respectively
A Memento ...
2
votes
2answers
147 views
Class with only one execution
I'm implementing a long algorithm (about 500 lines of C++).
The algorithm consists currently of about 10 different methods. Each method I have to hand over multiple data-structures as parameters, ...
1
vote
5answers
163 views
Class design, responsibility granulation, efficiency and performance
I am in a design dilemma. I have a set of data that can be interpreted in numerous ways, but I cannot really decide how finely grained should it be. To illustrate it with some simple code:
class Base ...
0
votes
1answer
62 views
Manipulating data for a single file
I'm looking for a best practice solution for creating an object whose responsibility it is to handle file storage for a single file. I want to be able to read data from the file, write to the file, ...
1
vote
1answer
116 views
Understanding Flux pattern
I'm actually studying the flux pattern and there's something that I can't understand concerning the stores.
What are they exactly?
I have read many articles, and it seems that it concerns the ...
0
votes
0answers
57 views
MVVM with multiple view models that share a model
I have an application where there is an "inventor" model whose data I would like to display differently in different areas of the application. Therefore, I'd like to create different view models ...
-4
votes
0answers
86 views
How to compress and send 36,864,000 numbers per second over a network? [closed]
You have a 3D mesh made up of 307,200 vertices. Or to put it in programming terms, you have an array with 307,200 entries whereas each entry is an object containing the properties id, x, y and z, each ...
2
votes
3answers
130 views
How to simplify structure of a monitoring software that uses the Observer pattern?
I am working on a project where I have to monitor the status of an elevator. So far, my design looks like this:
We are using a third party library to read and monitor real-time values from the ...
5
votes
1answer
97 views
Clean Architecture - How to go from “Database Driven” to “Independent of Database” [closed]
I am looking for some clarity and hopefully some advice on writing clean architecture for a large system. My Companies "Web Solution" is +-10 years old, my job is to rewrite it. It is written across a ...
10
votes
2answers
370 views
Is there a design pattern for managing deep many-to-many relationships?
I'm having trouble defining this data pattern I've come across working on several applications.
It consists of:
An object type which is composed of many objects itself
A second object type, where ...
2
votes
1answer
147 views
Is it a good idea to have separate UI components make their own webservice calls?
I have few UI components in an angularjs web-application. Each display data based upon same input. One shows stats which are calculated on the basis of a time period. Other shows a chart of daily ...
1
vote
0answers
33 views
Abstract Alert Dialog Builders (Same Method Calls, Different Objects)
Currently I'm working on an Android library that creates a dialog which allows to select colors from a palette (examples at the end) and I've stumbled upon an interesting design problem.
To create ...
4
votes
3answers
130 views
DDD design question
I have a question on modelling an Entity\Aggregate root in DDD. I am refactoring a project that uses Entity Framework and business logic as services, the services contain lot of logic which I believe ...
0
votes
1answer
43 views
Flux Pattern dispatcher broadcast
I'm trying to get a better understanding of the flux pattern Facebook introduced a while ago.
From what I understand the dispatchers dispatches every payload to all registered callbacks. Does anyone ...
0
votes
2answers
135 views
Repository pattern with service layer - too much separation?
I have an MVC site which uses the repository pattern. I don't feel like I'm using the MVC style enough, so I'm getting ready to re-architect some of it. But I'm also wanting to do it so if the ...
2
votes
0answers
66 views
Seperate settings and implementation class hierarchies
We use XML serialization to store class settings. Each setting-class has (but doesn't reference) corresponding implementation-class. Therefore we can easily make a "settings dll" without any ...
1
vote
1answer
83 views
Pattern for passing in a field as a parameter
I'm writing a Rails app which uses ActiveRecord ORM and a Postgres DB. I've got two attributes which are similar but are separate fields in the database. The assignment and saving of these is kinda ...
0
votes
1answer
56 views
How should one model an ExchangeService object (in ews-java-api) for sharing MS Exchange connections?
I am creating an application which uses ews-java-api to connect to an MS Exchange server. Once the connection is authenticated, the api dictates use of ExchangeService object for searching mailboxes, ...
11
votes
2answers
679 views
DRY principle in good practices?
I am trying to follow the DRY principle in my programming as hard as I can. Recently I have been learning design patterns in OOP and I have ended up repeating myself quite a bunch.
I have created a ...
2
votes
4answers
246 views
Good practice for holding immutable data
I'm wondering what is the best practice for holding immutable data, more specifically in C#.
For instance, lets say I have an immutable object called Foo.
public sealed class Foo {
public int ...
2
votes
2answers
104 views
Where to put the Country Table?
It might sounds like a silly question but here is my problem.
We have 100s of databases and in each of those databases, there is a country table. It was ok this way but we ran into minor problems at ...
0
votes
1answer
80 views
How to design resilient web service clients?
I am writing an app that is supposed to talk to a web service. Let's say it's a chat app. It would need to receive a stream of new messages (so that they are pushed to the interface as quickly as ...
1
vote
4answers
181 views
Strategy pattern and “Is a” relationship
Imagine, I have class IAlgo which is an interface. I have derived from him and implemented his single method called matchCount in different implementations - AlgoA1, AlgoA2, AlgoA3, AlgoB1, AlgoB2.
...
6
votes
1answer
140 views
UI Design patterns for non-screen based project
I'm working on a small project coded in Python that uses a single button for input and a RGB LED as feedback, which responds to button presses and asynchronous events from the network.
As the ...
2
votes
1answer
63 views
For DI, where to create dependencies (new objects) specifically within framework code?
Basic requirement
I'm making a framework for learning purposes (and likely usage on personal sites).
I'm using dependency injection in classes and I'm trying to design where would be a good place ...
5
votes
2answers
175 views
Persisting Large/Complex Entities with the Command Pattern — Am I doing it right?
I am in the process of designing and building a large-scale inventory management software-as-a-service that will, hopefully, live a long and fruitful life. Therefore I am exerting a lot of effort ...
-1
votes
2answers
133 views
Modelling a parcel management application
Scenario/Context:
I am working on an application which would find out the highest volume of parcel delivery based on the pin code of a particular area by reading a text file which has the list of ...
2
votes
0answers
41 views
Go - idioms/design for determining when an unknown number of goroutines are complete
I have a workflow wherein I walk recursively through a bunch of directories, then for each file perform some action. I'm using goroutines to walk each directory, and also to process each file. The ...
2
votes
1answer
95 views
Thoughts on having a generic, reusable grid viewmodel
I'm developing a wpf-based application and I'm currently struggling to find the best way of supporting a recurring scenario in it.
This app uses grids a lot. There are a bunch of features I want in ...
1
vote
3answers
124 views
How to understand if a property is a member of a class or I have to create a different class that holds it?
Sometimes when you create a class you can add there several properties (new data members) that you are not certain if you want to do or not. For example, I have a casino slots game. I have tiles and ...
0
votes
1answer
72 views
Implementing the State Pattern with Object.setPrototypeOf()
Take a look at this implementation of the state pattern in JavaScript:
var ON = {
switch: function() {
Object.setPrototypeOf(this, OFF);
this.state = "OFF";
}
}
var OFF = {
...
4
votes
3answers
137 views
Can a pimpl variation be implemented without any performance penalty?
One of the issues of pimpl is the performance penalty of using it (additional memory allocation, non-contiguous data members, additional indirections, etc..). I would like to propose a variation on ...
0
votes
2answers
117 views
How should I structure these Python classes?
Base Class
I have a class called Remote. This class represents a remote machine and has properties such as ip, hostname, username, and password, as well as methods for transferring files to/from the ...
1
vote
0answers
101 views
Does this seem a reasonable design? [closed]
I'm trying to design a program that:
Retrieves/saves pages from a MySQL table - each has an id, title, description, and page contents
Has the ability to draw pages either in HTML or PDF
Here are ...
1
vote
1answer
110 views
How to watch a message queue properly
I have a scenario where I need to 'watch' an Amazon queue. When a message arrives I need to get this message and process it.
Right now this is implemented with a do/while and Thread.Sleep when no ...
2
votes
1answer
81 views
Class structure for Entity Framework
I'm using EF (Code first) and I'd like to isolate the properties from the methods (many of the methods reference other libraries that I don't want my database project to have to reference).
As an ...
0
votes
1answer
116 views
How to avoid circular patterns in Node?
I'm new to Node and JavaScript (well, asynchronous programming in general) and I noticed when I was working on a project that the following code is a circular pattern and that these are bad practice ...
4
votes
0answers
95 views
What is the correct place to put checking of conditions in this use case?
Here is the situation:
I have a database and a class that is basically a representation of a set of fields of different tables in it. Let's call it Message.
"Message" does not know of the database ...
0
votes
2answers
67 views
How to better define SRP and “wholesome” objects? [duplicate]
Assume you have a class. It can really be any class that defines a domain concept like an employee, a product on an e-commerce site, or a car. One of those examples that are oldies but goodies. ...
4
votes
1answer
171 views
Understanding factories
I know there are hundreds of questions about this on here. I've probably read fifty different questions, blog posts and textbooks. The problem is I've gotten about 75 different answers. I have seen ...
2
votes
1answer
46 views
Best pattern for manager class that handles syncing objects between client and server
I am writing a client which has support of 'offline mode'. When offline records can be stored locally.
When we go online we want to be able to synchronize these records with the remote API.
I want ...
4
votes
1answer
68 views
Best practice for defining and keeping related stateless methods together in Objective-C
I have a few methods which are stateless:
loginWithEmail: password: completion:
signUpWithEmail: password: completion:
resetPasswordForUsername: completion:
Currently what I do is I create a class ...