Tagged Questions
A design pattern is a general reusable solution to a commonly occurring problem in software design.
0
votes
0answers
30 views
Implementing A Set of Rules
I have been tasked at work with implementing what I can only refer to as a rule interpreter. Part of my job is to identify production errors as they occur with shipment codes, and we are looking to ...
0
votes
0answers
9 views
Best design for Azure worker queue process
Consider the situation.
A worker was running on Azure Worker role. It will constantly polling on an Azure queue when an item found it will process the item. The process will have some jobs like job1, ...
-3
votes
0answers
34 views
Chrome Extension - Design patterns [on hold]
I will start with the development of Chrome Extension that is somewhat complex.
I would like to organize the code in MVC pattern style. The View is probably not that important but I would like to ...
0
votes
0answers
39 views
How to update a model with dependencies
I'm having a bit of a hard time figuring this out. I have a model (which you can see in the image below) this model can be changed (it won't happen often, but it can). When it changes I do not get the ...
1
vote
0answers
116 views
Design elevator system algorithm and classes? [on hold]
Here are the main classes I can think off the top of my head. All business objects will follow the abstraction (implement interfaces). I have not mentioned interface names
to avoid verbosity. I have ...
0
votes
0answers
36 views
DDD. Layers and objects involved to generate a report
Let's say one of my user cases is to generate an XML report of a subset of columns of sales that satisfy certain criteria, in this case sales between 2 dates, beginDate and endDate.
After having ...
1
vote
0answers
81 views
What is the first proposal of a middleware pipeline? [on hold]
To the best of my knowledge both node.js express and OWIN are based on Middleware. I found that notion for the first time in node.js connect module, and the following description clarifies the idea ...
3
votes
1answer
84 views
Designing a secure system that verifies the person registering a product is the end-user/customer
The scenario:
Our customer creates physical devices used in infrastructure across the globe
Their new devices have IoT capabilities and can communicate their status and other sensor data to the cloud
...
2
votes
0answers
79 views
Design Pattern for Internal Builder
There is an object which is very complicated to build and many algorithms needed to figure out how it should be created (for your curiosity it is an object that represents and draws the beaming of ...
1
vote
1answer
179 views
Why singleton is an anti-pattern? [duplicate]
Many articles in Internet say that singleton is an anti-pattern, because it makes debugging more difficult.
However I don't understand why debugging a program with a singleton object is difficult. ...
118
votes
12answers
15k views
Did the Gang of Four thoroughly explore “Pattern Space”?
Ever since I first learned about the Gang of Four (GoF) design patterns, at least 10 years ago, I am having the impression that these 23 patterns should be only a small sample of something much larger ...
0
votes
1answer
44 views
AMQP routing-keys naming anti-patterns when using topics
I'm working on the specification for building a web services platform and AMQP is the messaging protocol used for the interaction between the components of this platform.
I'm using topic exchanges ...
0
votes
2answers
47 views
Writing business logic in view
Can writing business logic in the view(.cshtml) of an MVC application have an impact on performance (for example, Load time)? Is it the preferable way or are there any other best practices?
-2
votes
1answer
119 views
Is OpenGL just badly designed?
I have been using OpenGL and OpenGL ES for a long time, and I know them pretty well. They're also really, really annoying to use, and I haven't really seen this discussed anywhere. Here are some ...
4
votes
3answers
122 views
Handling errors in C with “check-log-return”: why not use a macro?
It's a good practice (I believe) in C to handle errors like this:
int status = tree_climb(tree, ...);
if (status != 0) {
global_logger.message(2, "Cannot climb a tree %s", tree->name);
...
165
votes
15answers
34k views
My boss asks me to stop writing small functions and do everything in the same loop
I have read a book called Clean Code by Robert C. Martin. In this book I've seen many methods to clean up code like writing small functions, choosing names carefully, etc. It seems by far the most ...
-2
votes
0answers
50 views
what design pattern can I use to create an object that implements a specific interface or multiple or any combination among the available interfaces? [closed]
what design pattern can I use to create an object that implements a specific interface or multiple or any combination among the available interfaces? for Example say I have the following
interface A {...
1
vote
1answer
46 views
Database rollover handling patterns
I have a question regarding the design of an application where the database system has a rollover. To clarify the context :
the database system (a cloudant instance) is fed with sensor data by an iot ...
0
votes
1answer
71 views
Best practices to require simultaneous write in storage objects
This question is on program architecture and relationship between DAL, Security and BLL in case, when simultaneous write in several storage objects is needed. I address it to Microsoft SQL Server ...
1
vote
1answer
51 views
Good design patterns within JavaFX — MVC?
I have used a lot of JavaFX and am familiar with the technical aspects. Now, as I foray into a very large application with hundreds of views, I want to make sure I start strong with a solid design. ...
3
votes
4answers
126 views
Hierarchical structure that needs to enforce availability
The project I am working on has deep parent/child relationships that needs to enforce availability.
Imagine we are a large Worldwide Electronic Seller (Best Buy) and selling mobile phones
We have ...
4
votes
0answers
166 views
+50
MVVM best practices with WPF client and WCF duplex service
I've been thinking about how to design my WPF application, which receives data from a WCF duplex service, but I'm afraid of over engineering.
I thought about abstracting away the WCF communication ...
2
votes
2answers
252 views
What's the suitable pattern to create a wrapper around the content of the application
I want to wrap every next web application with A top menu and right menu like this :
Every new application should be integrated in this master wrapper.
I thought to create a master page for the ...
3
votes
1answer
81 views
How would one avoid circular object references when each element in a collection can possibly interact with any other element?
I have a class called Canvas that acts as the container for a number of Rectangle.
The Rectangles have the following behavior:
They can be moved within the Canvas.
They can be resized.
They may not ...
2
votes
1answer
54 views
Architecting Service, Manager and Model classes for concurrency in a web application
Let's say that I have a chatroom application that manages rooms, users, and messages. I'm building this out as an opportunity to practice some service/manager/web separation and teach myself good ...
0
votes
2answers
99 views
Repository Pattern with Multiple ORM
We are developing the application with MVC and Repository Pattern. Currently we are using EF as an ORM. But Later we need to change the ORM to nHibernate.
Any Idea on the architecture.
Currently I ...
0
votes
1answer
31 views
How to design and store life cycle or states for a java entity bean?
In our application, we have a pojo mapped to some entity. One pojo refers to one entry in DB. There are multiple steps for it's life-cycle. It gets created freshly, it goes 'live', after some ...
1
vote
3answers
168 views
Handling diverse “plugins” while staying sane
My colleagues and I are struggling with a design problem. I'll try and explain
the situation:
We have a number of different components (let's call them plugins), that take
an input, do something ...
0
votes
2answers
111 views
Where does business logic fit in the Command Query Responsibility Segregation Pattern?
Suppose I have a method like this:
public int CalculateAge(DateTime birthDate)
Is this a Command? Query? Or should it be separated and not included as either a command or query?
It fits the query ...
3
votes
3answers
225 views
Does the use of frameworks make it unnecessary to learn design patterns?
I don't want to say that is not necessary knowing design patterns. I just want to tell you my experience.
I've used Spring frameworks for four years and another frameworks (JSF, Mybatis, Hibernate, ...
2
votes
1answer
137 views
Is there a name for a design technique where an object's method takes input and returns custom business object?
What do you call a class that has methods that
take input (from user, from GET or POST)
transform it to a business object and return that object
example ...
class Input
{
function getObject(...
4
votes
2answers
201 views
How to parameterize Commands without the caller “knowing” anything about the Command ahead of time
My question is similar to (but not exactly the same as) this question. This question was also helpful but it is less similar to my current question than the previous question that I linked to.
I have ...
180
votes
9answers
18k views
Is there a name for the (anti- ) pattern of passing parameters that will only be used several levels deep in the call chain?
I was trying to find alternatives to the use of global variable in some legacy code. But this question is not about the technical alternatives, I'm mainly concerned about the terminology.
The ...
1
vote
1answer
82 views
Design a java based menu so that it's easier to add new options
I am trying to create a java console program which displays a Menu with few options. Each option selection performs some independent operation say executing a script or performing some db operation, ...
4
votes
4answers
138 views
Patterns for controlling how an interface is implemented
This is more a curiosity than a real-world requirement. As an example to demonstrate what I mean by 'Controlling how an interface is implemented'..
Say I wanted to implement a new task scheduler, and ...
8
votes
4answers
289 views
Code structure to handle multiple markets? (different business rules for every state in the USA)
We're developing an app that has slightly different requirements for each business market (countries and states) that it's available from. It seems like a common situation but I can't seem to find a ...
5
votes
1answer
184 views
How do I remove smell from a pluggable DAL
I am working with an application that is composed of several different, disconnected, components and each piece has a dependency on up to three different Data Stores (SQL Server, Doc Storage, BLOB ...
0
votes
1answer
87 views
Is the -Impl suffix a legitimate naming convention for a Hook method in Java?
I was going over some old code and found the following peculiar naming convention at a template method implementation.
// TEMPLATE METHOD
// Checks condition and fail fast if condition is met.
// ...
4
votes
8answers
479 views
Avoiding instanceof vs abstract God Class. Do I have an alternative?
I have a large number of classes with an abstract base class (A) that contains behaviour that must be supported by all the sub classes say [B..I].
In my code, I end up with a collection of objects ...
5
votes
1answer
224 views
How do I structure my code to avoid tight coupling between my parent and child classes?
I'm using a third party product that has a class I can extend to provide a new way for that product to get data (the product is Sitecore but I don't think it's super relevant to the question).
They ...
5
votes
3answers
191 views
How can I generalize multiple distinct classes as a single class, united by purpose?
I have a StringValidator. A StringValidator is either a Regex or a string pattern using '*' wildcards. I want the StringValidator.StringIsValid() to perform one action or a different one, depending on ...
0
votes
1answer
83 views
Design pattern for java service class
Java service classes...
I have two service classes one for 'store'(save) data, another service for 'load' to display content.
It was implemented , now new requirement - depends on user input for load ...
-1
votes
1answer
88 views
What if Facade contains business logic?
Consider that the Facade has inside it lots of sub-components but it done not pass messages from one sub-component to the other but also has some business logic in it. Is it still Facade pattern?
1
vote
3answers
85 views
Web form repopulation after invalid submit
In general, what should be the best way to repopulate a form when submission fails due to invalid inputs.
Here, invalid would mean something did not pass the check or some validation methods server ...
0
votes
0answers
20 views
saving and using search form and/or menu links parameters
I have s seach form on start page of the website on submiting the form which has 10 fiels/selectboxes I want to save the search criteria of the user in session
on submitting the form the user lands ...
-1
votes
0answers
44 views
Lazy loading (Paging) data from external API [on hold]
I am writing a mobile app and I am currently making design decisions about fetching data from the server.
Description:
A single data item fetched from the server can be seen as an object with ...
4
votes
4answers
303 views
Design Pattern for Indirectly Connecting Two Classes
Admittedly, this is a homework problem but I have tried to figure it out on my own. Just want to make sure I get it correct. So far, the only design pattern I believe to be correct would be the ...
5
votes
2answers
408 views
How are generics implemented in a modern compiler?
What I mean here is how do we go from some template T add(T a, T b) ... into the generated code? I've thought of a few ways to achieve this, we store the generic function in an AST as Function_Node ...
3
votes
2answers
146 views
Design pattern for free / premium user role
this question is actually about a complex java project I am doing at university, but it is possible to find a simple case which is really similar to the problem I am facing.
In this scenario, we have ...
1
vote
1answer
82 views
Pattern for dealing with different File Types
In my application I fetch files from the user and process it.
Im to limit to a certain scope of file types and each one of these has a different processing approach.
How can I design the application ...