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

learn more… | top users | synonyms (1)

2
votes
1answer
123 views

Lower class count vs explicitness

To help with an application that manipulates and works from an XML structure to produce other information, I've created a class structure that closely follows the XML structure. So, the XML is: ...
0
votes
2answers
156 views

Should I create a new class?

Let's say I have a Car class. Objects of this class will be stored in a collection, and every object should know about other elements in the collection, because for each car there's a value to be ...
1
vote
1answer
69 views

Custom Outlook Web App Shared Mailbox

We currently have a large amount of custom mailboxes hosted on Lotus Notes/Domino and have been tasked to migrate these over to our Outlook/Exchange environment. The mailboxes are basic Lotus Notes ...
2
votes
1answer
163 views

Creating multiple instances of an implementing class

I currently have an abstract class and multiple classes extending it. My problem is, that there has to be a way to create a variable number of instances of an extending class. The number of instances ...
0
votes
0answers
74 views

Class design of keyboard interpreter to execute commands

I'm designing a keyboard interpreter that will map typed characters to a (or many) command(s) via a hierarchical menu-style structure, taking into consideration testability (ideally TDD). However I'm ...
0
votes
1answer
96 views

Best practice for settings for PHP class for code generation [closed]

I would like to have a class creating any code from given options and output it in a chosen way. I have written class for generation of simple JavaScript code for such cases where is needed to ...
0
votes
0answers
65 views

What benefits does React bring over Partial Views

Beside the performance optimizations that React brings to the table with the Virtual DOM : conceptually, in terms of end-software design, what does React brings to the table that partial views did not ...
0
votes
0answers
53 views

Test Utility in Spring: Singleton or Static

I'm working on Test Utility in a spring project, this utility contains a methods to convert an object to JSON object and vice versa..etc and I'm confused if it's better to make the methods as ...
0
votes
0answers
46 views

Merging waitable objects

Lets say you have two (or more) objects from which both allow a thread to wait for an event to occur. Foo.Wait(timeout); Bar.Wait(timeout); The main thread wants to wake up when either of these ...
1
vote
0answers
56 views

Creating duplicate instances of objects for timeline functionality

I am working on a Spring-MVC based project, in which I would like to add Timeline functionality. The most important object in our project is the Note, there are objects associated with it like ...
4
votes
3answers
215 views

How to use a strong type system to model business constraints?

Following up on my ambiguous question, here's a question that is probably more focused. Consider the following code snippet form a Haskell program: data NightWatchCommand = InvalidCommand | ...
28
votes
5answers
2k views

What is an effective way to record rationales behind product design decisions?

At our company, we do not use any product design documents. We have three employees total so all product design discussion happens in person, or on Slack. (We are also on the basic Slack package that ...
3
votes
2answers
289 views

Only use a dependency injection container at the root of an application?

normally, I'll use a dependency injection container (unity) in c# like this example: class SomeClass { private readonly ILogger _logger; public SomeClass() { _logger = ...
1
vote
1answer
68 views

How to determine what type of derived-class object to lazy-load from an associated object

I'm modelling a system that is a combination of two distinct yet similar data repositories**: one containing patent data and one containing trademark data. There is a very large overlap in the ...
0
votes
0answers
55 views

Publish / Subscribe via HTTP Callbacks?

My team is tasked with creating a publish/subscribe system for incoming REST messages. 99% of the time, this system will be used for notifications between different processes on the same cpu, but we ...
8
votes
3answers
377 views

REST API design for web pages with wizards

I have a web page with wizard format. The submission button to the API will be in the 4th step of wizard. However I want the data entered to be stored in database before moving to the next step in the ...
5
votes
1answer
179 views

Architecture for Web application to monitor remote servers

So I'm a relatively new programmer, attempting to create a web application (ASP.net) to display the system information (E.G. Status of windows services, disk & resource usage and errors in event ...
2
votes
2answers
127 views

Abstraction on Iterator Pattern?

Recently, I had the task to implement a research project where I had to read an XML file. XML file contained a list of messages that I had to send to some other system on a specific port. Each message ...
3
votes
1answer
96 views

Snap to grid functionality in drawing application

I'm working on drawing application and I want to provide grid with snap to grid functionality. I'm trying to find the right way how to do that (ideally some design pattern), but I'm quite confused ...
-1
votes
1answer
45 views

how to implement cross-platform / cross-technology system in common practice

Reading and observing some of the startups and well-known services, almost every time I found that people there are using cross-technology system in their architecture. For example like Twitter, used ...
1
vote
0answers
41 views

“Flexibility” - Multiple ways for users to do the same thing

Situation: I've recently joined a new project, and I've quickly noticed that the team is very keen on keeping the code "flexible." It seems that for each class or function, they don't want to prevent ...
1
vote
2answers
70 views

How should I apply the Single Responsibility Principle to DLLs?

I mainly hear about people applying the principle to classes and methods, but do people also apply it to solutions/DLLs? For example, if I was writing a library to parse data from UsefulProgram, and ...
4
votes
1answer
244 views

Who communicates with the database in MVC/MVP?

I am building a small application and want to save my business objects to a database. I have my business objects and a model that acts as a container for my business objects and provides methods for ...
9
votes
5answers
3k views

Solutions for floating point rounding errors

In building an application that deals with a lot of mathematical calculations, I have encountered the problem that certain numbers cause rounding errors. While I understand that floating point is not ...
3
votes
1answer
210 views

Integration between services in a SOA

Assume we have a Bounded Context for Inventory (InventoryBC) and another one for Shipments (ShipmentsBC). These 2 BCs need to communicate together. They are hosted on 2 different services on different ...
2
votes
0answers
79 views

Confused about how to 'design' my (leaflet.js) map application; OOP

I asked another question recently regarding constructors calling constructors in order to organise my code properly but the answers really ended up giving me more questions than answers (which is good ...
32
votes
6answers
42k views

Difference between a service class and a Helper class [closed]

I would like to know what differentiates a Service class from a utility class or a helper class? A class only with underlying methods calls the dao's is a service? Doesn't the usage of Helper ...
0
votes
2answers
115 views

Writing extensible versus deletable code [closed]

I know this might just be semantics, but reading the article titled Write code that is easy to delete, not easy to extend made me think that perhaps it is more or less along the same lines of creating ...
0
votes
1answer
37 views

Boolean flags in Presenters to control flow of execution

I can see people use boolean flags, especially in Controllers / Presenters, to control the flow of execution. For example, public void onButtonClicked() { hasButtonClicked=true // code here ...
29
votes
8answers
4k views

Are classes with only a single (public) method a problem?

I am currently working on a software project that performs compression and indexing on video surveillance footage. The compression works by splitting background and foreground objects, then saving the ...
0
votes
0answers
57 views

Concepting a Server - Handling Clients/Connections

I am writing the Server-Side of an Application, just for practicing my Java programming skills. I have made an attempt to program it, but I am not satisfied with my solution and I think it is because ...
7
votes
1answer
198 views

How should the code for a program outputting to command line be tested/designed?

Imagine a program similar to this in Python: import subprocess class Example(): _cmd_args = (['ls', '-a', '/usr/bin/'], ['ls', '-al', '/usr/local/bin/']) _default_args = 0 def ...
-1
votes
1answer
69 views

Considering the testing software issues when designing software [closed]

When designing the software, must we consider how much this code could be testable? for example, if we used X technology/Class/Interface instead of Y, based on that X can be tested more easily than Y, ...
21
votes
5answers
32k views

Designing a REST api by URI vs query string

Let's say I have three resources that are related like so: Grandparent (collection) -> Parent (collection) -> and Child (collection) The above depicts the relationship among these resources ...
1
vote
1answer
1k views

MVC URL structure with URI parameters

When creating routes for your MVC web application I have seen two possible ways to pass variables to a controller method: With the first approach the variable is passed to a parameter of the ...
13
votes
9answers
5k views

Data structure for accessing units of measure

TL;DR - I'm trying to design an optimal data structure to define units within a unit of measure. A Unit of measure is essentially a value (or quantity) associated with a unit. SI Units have seven ...
0
votes
0answers
36 views

Logging strategy for login transactions

We have a login process which is facilitated by a product default logging mode of which is text file based. Now because that is log4j based logging, one can use the custom appended to call our ...
1
vote
1answer
303 views

Loading dynamic CSS based on user

I want to provide different UI theme based on user who logged in. For that I have came up with following 2 options: Create separate files for all themes duplicating all the common CSS. This way I ...
0
votes
0answers
32 views

Unifying database interface for multiple authentication methods

I'm working on a project with Mongo as the db. Currently, we only allow users to sign up with email and we look them up in the db by email address. But now we're moving to allow users to sign up ...
29
votes
7answers
15k views

Why avoid Java Inheritance “Extends”

Jame Gosling said “You should avoid implementation inheritance whenever possible.” and instead, use interface inheritance. But why? How can we avoid inheriting the structure of an object using ...
2
votes
0answers
50 views

Designing a web based smart card publisher

I'm working on an application that's supposed to have a web based GUI where you can insert some data. That data will be saved in persistent storage and a hex number generated and stored alongside. ...
0
votes
0answers
70 views

Is pure RESTful required for Angular JS / Backend running on same web server?

I am developing an application with Sprintboot + REST + Angular. While I am working on the REST API, I am trying to design as RESTful as possible. I'm encountering certain pages where the Angular UI ...
2
votes
4answers
279 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. ...
23
votes
6answers
26k views

Should session variables be avoided?

I used to heavily rely on session variables in the past, but have recently found many of them to be unnecessary, using things like query string parameters instead. A colleague of mine refuses to use ...
32
votes
6answers
6k views

Is an event loop just a for/while loop with optimized polling?

I'm trying to understand what an event loop is. Often the explanation is that in the event loop, you do something until you're notified that an event occurred. You than handle the event and continue ...
6
votes
1answer
268 views

What is the best way to approach visualization projects?

I work on several areas related to information visualization, linked data, computer vision and other stuff, so mainly front-end. I am not really happy with the fact that visualizations take lots of ...
1
vote
2answers
95 views

Decoupling external dependencies

We have a simple REST webapp which is dependent on multiple external services, mostly Kafka messages. An attempt was made to isolate external dependencies by encapsulating all external interactions in ...
7
votes
8answers
656 views

Class as first-class object

Could a class be a first-class object? If yes, how would the syntax for dynamically creating new classes look like? To narrow the question - how would you give this functionality while keeping ...
-2
votes
1answer
50 views

Considerations when making data structure and algorithm choices [closed]

What are some reasons you may choose a worse runtime algorithm? And what are some advantages of a linked list vs a hash table/array where access is constant time.
2
votes
1answer
74 views

“Selected design can be derived from requirements” - meaning and difference against traceability?

ISO 12207 contains interesting points for design verification: a) The design is correct and consistent with and traceable to requirements. c) Selected design can be derived from ...