Questions about problem solving and planning for a solution through software design.

learn more… | top users | synonyms (1)

14
votes
9answers
12k views

Use constructor or setter method?

I am working on a UI code where I have an Action class, something like this - public class MyAction extends Action { public MyAction() { setText("My Action Text"); setToolTip("My ...
2
votes
2answers
44 views

AMQP broker and happen-before guarantees

I am trying to figure out how an AMQP broker, such as RabbitMQ, can be integrated in our architecture. This should allow to easily scale horizontally in the future. For the sake of simplicity, let me ...
1
vote
1answer
65 views

Should written use cases be consistent with use case diagram?

I'm developing a video web system like YouTube where users can upload, view, update and delete their own videos (CRUD operation). Original I drawn the use case diagram like this: But I learned ...
0
votes
1answer
25 views

Design question to best option for storing data in file or DB

I am working on a feature where I need to store some data and I am not sure what should be my best option to store this data. I am sending data to some third party and want to show some part of that ...
7
votes
4answers
373 views

Is it bad practice to reuse method parameters?

There are times when I will need to modify a value passed into a method from within the method itself. An example would be sanitizing a string such as this method here: void SanitizeName(string Name)...
1
vote
2answers
142 views

Designing validation classes

This is a follow-up of this question. I decided to implement what the accepted answer suggests, however, I realized I also needed individual public methods for each member the entity to be validated ...
14
votes
5answers
4k views

A language based on limiting amount of arguments passed to functions

The idea is inspired by the fact operators such as +, -,%, etc. can be seen as functions with either one or two arguments passed, and no side-effects. Assuming I, or someone else, writes a language ...
-3
votes
0answers
63 views

How to design property files

I always wonder what is the best way to design your property files. I have few questions that I didn't find an answer to them Do we place all our labels / error messages in one file? Do we split the ...
1
vote
1answer
48 views

Decoupling the loading of data, sorting and usage

I have the following requirements: Load data from a variety of sources and fill a list with it Use a batch of data to perform some computation Some additional information: The algorithm for ...
0
votes
2answers
121 views

Is an empty class in some cases correct

I know it's generally a design flaw to have an empty class, yet I'm wondering whether there are some cases where it isn't to have an empty (abstract) class to group objects. Especially when ...
2
votes
4answers
152 views

Are factories that only return one type of object bad?

Someone in a Stackoverflow post (I didn't bookmark the question unfortunately) commented, that Factories that only return one type of object are a code smell. I find myself writing these kinds of ...
1
vote
2answers
76 views

How do you represent an object when you need to know which subtype you're working with?

I have some data that I need to represent in a form. As an example, it might look like this (in psuedo-json): [ { "value1" : "int" "value2" : "{1, 2, 3, 4, 5}" "value3" : "...
2
votes
0answers
86 views
+100

Symfony2 - Best aproach for a plugin system

Symfony2 is handling all its things in bundles in /app or in /vendor. This is fine, if you are handling and managing all by yourself or Ops that handle all needed things. But I haven't found a good ...
-1
votes
1answer
78 views

Controllers and Separation of Concerns: discussing possible strategies

I've been working on a project based off of this tutorial. Unfortunately, the controller classes in this are quite dense and have terrible separation of concerns. I should have realized this ...
0
votes
1answer
65 views

GitFlow, should my release branch include minor version number?

I've found it difficult to find a definitive answer to this question. Using Semantic Versioning and GitFlow should my release branch include the minor version number? I'm not referring to tags. My ...
0
votes
3answers
278 views

Simple React application design

I have a very simple app that lets you log in and then displays a dashboard. The design process with React and Redux is very simple : I have two React components : Login and Dashboard I store a ...
7
votes
3answers
299 views

Is mutually referencing classes a consequence of bad design? [closed]

I am currently working on a small game I did in about ten days. Since I am programming for myself, I am being lazy and going to the easiest solution with (too) little concern about bad code quality. ...
5
votes
1answer
304 views

Need to re-build an application - how?

For our main system, we have a small monitor application that sits outside our network and periodically tries to log in to verify the system still works. We have a problem with the monitor though in ...
3
votes
6answers
320 views

Mutability and getters

In the example below, I have a Person class and class B that holds a reference to a Person. Person has a public foo1 method that can alter its state (it's a mutable object). Suppose clients of class ...
1
vote
3answers
95 views

Implementing an event scheduler for animations

The basic idea is to have some animated widgets that sit in a container, quite similar to Qt (the only actual difference is that my widgets are animated). The animation is in some cases dependent on ...
55
votes
8answers
6k views

Should a developer do UI mockups if there are no designers in the project?

I'm working with a small team that creates a proprietary web application and UX isn't much of a priority since our own people will be the ones operating it, but we do try to make their jobs easier. ...
1
vote
4answers
51 views

Handling missing values in response

Suppose a web application relies heavily on the third party APIs and I am expecting a response from it but somehow I don't get any, maybe because of the API exception or missing value on the API side ...
0
votes
3answers
109 views

Cyclic dependency in this project design

I have 2 modules (containing multiple classes). Let's call them Module A and Module B. Module B has a dependency on Module A: Module B -> Module A. Now, I have created an utility class C, which A ...
0
votes
0answers
46 views

Making DAO's independent on each other

I have these two classes (Getter/Setter/Constructor omitted): public class Company { private String name; private String adress; private List<Employee> employees; private Uuid ...
4
votes
4answers
337 views

Are there any alternatives to dependency injection for stateless classes?

I am working on an application whereby I have designed classes to fit into several groups: Immutable: initialised through constructors, uses copy-and-swap idiom (inc. move), can deep copy (i.e. ...
1
vote
1answer
48 views

When to have a generic method for multiple tasks when some differ?

I process a lot of tweets in real time using python and for each tweet I need to assign it in to a specific bucket. I have about 50 buckets, each with their own rules. The majority of them are simple ...
0
votes
0answers
48 views

How does maven internally manages package dependency?

Can some let me know how does maven internally manages package dependency? Is there any architecture diagram available on the net for the same? I also asked this in Quora and maven user mailing list ...
1
vote
1answer
159 views

is this a good design

For example, I have a clan and a character. There's a character that is the leader. To give the clan a specific feature, some money from the character is required. I don't want to have too much tight ...
0
votes
3answers
228 views

DDD Request Validation Handling

I stuck somewhere that I can't find a solution! There are plenty of validation questions here, but as far as I see, most of them were asking about entity validation. But what about request validation? ...
-2
votes
1answer
77 views

Design pattern options for a web framework [closed]

I'm currently working on a Python web socket server framework to develop new services easily. I'm not the original developer of the project and I think the design could be improved, so I'm asking ...
0
votes
1answer
41 views

How to check foreign key dependency in ddd aggregate root

When I want to call a constructor on aggregate root class Task, I am interested how can I check if a passed taskType exists in TaskType repository (enforced later in DB on ORM level). I want to ...
2
votes
2answers
114 views

Ubiquitous language and resource based REST API?

I have posted a question regarding Ubiquitous language and maturity level in REST API. Ubiquitous language and maturity level in REST API? After some extensive coding I realized that further ...
0
votes
0answers
71 views

Can I keep my code loosely coupled with public-facing enums?

I have some enums in a concrete API/library that will be publicly used by application projects. My problem here, is that I cannot write an interface to these enums (that I know of). I should have ...
1
vote
2answers
95 views

Single Class to Serve as View Model as well as Container for Submitted Form

I see the following design in the code which is part of the default web application project in visual studio: A single data model class in constructed and decorated with various data validation ...
1
vote
3answers
102 views

Event logging: record a whole message, or a list of properties and generate?

I've written a simple event logging system, which I write to with a function similar to: void IIncidentLogic.ReportIncident( string code, string noun, string hostname, DateTimeOffset ...
1
vote
1answer
27 views

Redesigning schedule value hierarchy

I have a couple of schedule value classes that represent the value a schedule holds for a specific slot. First, there's the ScheduleValue class for schedules with two dimensions, where the first one (...
0
votes
2answers
59 views

Is it a different object or the same object with an altered property (mutable or not)?

When I design the architecture of an application, I usually think about the nature of the objects and the interactions between them. The way I currently think about mutability is to ask myself if ...
7
votes
2answers
729 views

Implementation of communication between packages (Java)

I'm making a project with 5 packages. The packages can communicate with each other by sending Messages to a central MessageQueue in the Main package and that MessageQueue takes care of all the ...
3
votes
2answers
93 views

How should I refer to data bound columns?

I work often with data-bound applications with WinForms; records are pulled from a database and updated in a client application that I write. Stored procedures are used for all database transactions ...
2
votes
3answers
293 views

Design periodic batch notification system

Problem: I am trying to design a system which takes requests from customers in real time and log them in a database. For example - request to purchase an item. The customer then gets a unique ...
-1
votes
0answers
20 views

logging another device using exscript PYTHON from already logged into device

I am using Python's Exscript module to log onto network device (Juniper/Cisco), once in I fetch vrf details and use same to log onto another device which is basically a SWITCH. I am stuck how to I ...
2
votes
1answer
107 views

Where do you print IO error messages from in a console app?

I'm writing a simple console app to rename a bunch of files/folders, and I want to design this console app to be as modular as possible. The console app is as simple as it gets: Ask the user what ...
2
votes
2answers
105 views

How To Design Time Slot Based App

I have got a responsibility of designing an app which allocates time slots for doctors booking. The scenario is like, there'll be entry for doctors and their time slot for each days. For E.g. ...
3
votes
1answer
569 views

How do I implement role permissions in the service layer?

In my current project I have a Report class, and I am going to implement a service layer for it. Every method will be allowed only for some roles. Like this: public class ReportService : ...
0
votes
1answer
137 views

Onion architecture vs 3 layered architecture

I see only benefits to the onion architecture over the 3 layered architecture where the BL had responsibility to call methods on DAL (or an interface of DAL) to do CRUD. The onion has better ...
40
votes
15answers
8k views

Is it inadvisable to make a function that essentially renames a built-in function?

I get confused over min and max functions, in certain contexts. In one context, when you're using the functions to take the greater or lesser of two values, there is no issue. For example, //how ...