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

learn more… | top users | synonyms (1)

1
vote
1answer
74 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
31 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 ...
10
votes
4answers
563 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
1answer
51 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 ...
1
vote
2answers
142 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
186 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
78 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
181 views

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 ...
-2
votes
1answer
80 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
68 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 ...
7
votes
3answers
302 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
314 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
329 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 ...
56
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. ...
0
votes
0answers
49 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
403 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
56 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
54 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
162 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 ...
2
votes
2answers
130 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
78 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
3answers
103 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 ...
0
votes
2answers
60 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
745 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
95 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
1answer
118 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
134 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
633 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
165 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 ...
1
vote
4answers
168 views

Where should “conversion” functions be placed?

I have a type Bound as a sort of "alias" for an array of three numbers (working in TypeScript with: type Bound = [number, number, number]). I did this basically to help readability by specifying in ...
4
votes
3answers
407 views

What is the preferred way of communicating between applications on the same system?

I'm designing a system that is built on several small applications written in python, some of these will be services and others will be programs that only run during special situations. What I need to ...
1
vote
1answer
52 views

Design question (use the same instance or copy?)

We are developing an e-learning website where you can practice LearnItems (typically words of a foreign language). The concept is very similar to Memrise. When a user practices a LearnItem, a Result ...
0
votes
0answers
22 views

Schema design (SQL) for incorporating an alerts system tied to users

I've been working on an app to hone my skills while building something that will be useful to me. It's being built using Ruby on Rails, but this question is mostly language agnostic. I'm currently ...
4
votes
2answers
209 views

Organizing maven modules and spring profiles

I'm facing a design problem with Spring's profile and Maven multimodule project from which i'm building a product, as a web as application that can be customized for differents clients. For this i ...
1
vote
4answers
1k views

How do you make a service stateless?

When doing Domain Driven Design it is advised that services should be stateless. There are several kinds of services when doing DDD: Application services. Domain services. Infrastructure services. ...
5
votes
6answers
4k views

Can recursion be done in parallel? Would that make sense?

Say, I am using a simple recursive algo for fibonacci , which would be executed as: fib(5) -> fib(4)+fib(3) | | fib(3)+fib(2)| fib(2)+fib(1) and so on Now,...
1
vote
2answers
172 views

How can you enforce a “do you really want to do this” confirmation in a publically exposed API?

Is there a commonly (or rarely) used pattern for a "confirming you want to do this" message when calling a function from a library? I have a API that exposes some operations that are potentially ...
3
votes
2answers
145 views

How to check if app is offline

I am developing internal Android apps for the company I work for. In various places in the apps I need to connect to an internal server. This server is shutdown for maintenance for a period of time ...
5
votes
1answer
278 views

Small classes and methods, but code still difficult to maintain and follow

Did I do something wrong in my code organization ? I still find my own program difficult to follow. I tried to decompose my program on small, easy to understand classes and functions, still I find ...
2
votes
1answer
99 views

Is it anti-pattern to alter domain model on front end?

We are making a quiz application, I'm trying to integrate my Angular 2 UI with the REST api. Our Quiz domain model consist of the following (simplified) hierarchy: -Quiz -Category -Question -Choice ...
0
votes
1answer
576 views

Modeling user in MongoDB

Our team is learning to work with MongoDB. We have to model the user among other things for an OAuth-based application. We know how to model in the relational world, but are unsure about how to do it ...
-1
votes
2answers
82 views

Connecting an HTML form to a Java program [closed]

I would like to create a front-end interface in HTML that interacts with a Java program via an HTML form. I would like to be able to publish this project on the Internet. In other words, the text ...
2
votes
2answers
175 views

Depend in the direction of stability: How do I know what is more stable?

According to the Stable Dependencies Principle, the dependency should be in the direction of the stability But: if you don't know what types of changes are likely, it is best to wait and see ...
3
votes
2answers
138 views

Creating instances of an interface through a static method

Is the following design flawed? Basically I have a main class used to create an object of a type and then return it as the main interface of the type. The problem with this is that each of the ...
3
votes
2answers
54 views

Composition model class with edit feature

I have a model class like below. I need to edit items, but the model has to know when any object has been modified. Also I need to provide very often with the objects inside to the view, which is who'...
5
votes
6answers
2k views

C# Design, many properties, complex constructor and equality

I'm still a relative novice with OOP, so I am still trying to understand some of the best practices for how to design "good" objects. I know this question is probably a rather subjective, which is ...
27
votes
8answers
4k views

Value of using private methods vs all public in classes for internal software for ease of unit testing [duplicate]

Here's a skeleton of a class I built that loops through and deduplicates data - it's in C# but the principles of the question aren't language specific. public static void DedupeFile(FileContents fc) {...
2
votes
3answers
243 views

Why do assertions in Java need to get enabled?

I really like the concept of assertions in Java in the way how to use them. It's much easier than to write an if and then throw an Exception/Error. But the thing I don't understand is, why do they ...
1
vote
3answers
174 views

How to gently steer a giant PHP app toward better practices? [duplicate]

So I'm responsible for maintaining and enhancing a PHP codebase that runs to around 1,100 files and 120,000 lines of code. In general, it's not terrible, although since it was written over some 10+ ...