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

learn more… | top users | synonyms (1)

0
votes
1answer
55 views

Standalone library for error logging?

Background Here is how I currently log any exceptions that occur in my code: Pass each object instance the path to a file where I want all of the logging to happen. Each of the objects have their ...
3
votes
2answers
135 views

Ubiquitous language and maturity level in REST API?

According to Richardson Maturity Model there are several levels of maturity in REST approach. http://martinfowler.com/articles/richardsonMaturityModel.html Since DDD uses ubiquitous language, I am ...
1
vote
1answer
70 views

System for scheduling parallel tasks/callbacks

I am looking for a system for building state machines with timed/scheduled transitions, and with events that happen periodically during a given state. I can implement it myself, though I feel like ...
1
vote
0answers
37 views

Drawing sequence diagram for user-forget-password functionality

I'm trying to draw a sequence diagram of the functionality of user retrieving their password when they forget it and its procedure could be illustrated in this activity diagram. As you can see, ...
2
votes
0answers
64 views

What are the benefits of an input/output component design?

For the company I work at, all of our projects, including a new one started last year, are written in C89. We write for vxWorks (a real time embedded operation system). Our software runs ...
0
votes
1answer
31 views

Sdk building, declare dependencies inside the assembly or use external?

At my company, we're building an SDK consisting of a number of assemblies. For example, we deliver an assembly called Company.Platform.Security that contains the implementation of our authorization ...
2
votes
1answer
182 views

Why support cyclic dependencies at all? Are there valid use cases?

Background Time ago I learnt something about package design, in particular about loose coupling: The Acyclic Dependencies Principle The dependency structure between packages must be a ...
0
votes
1answer
43 views

What kind of data structure should be used to store components in an electrical schematic program?

Is there a specific data structure, object oriented programming methodology, and/or approach for achieving what programs like LT Spice, Altium Designer, and Cadence Virtuoso use to manage ...
1
vote
0answers
76 views

How to authentication user in REST API (domain driven design)

I am using REST API as a presentation layer of a DDD project. In order to secure API calls I am using token based security. ...
2
votes
3answers
80 views

What should be primary guideline when defining a bounded context?

When defining bounded contexts of a Domain, what should be a primary guideline: departments (Sales/Manufacturing/Warehousing), where each department has a common context ...
-2
votes
0answers
41 views

When the system metaphor does not work

I'm trying to figure out how to combine the metaphor system with patterns. For example, with MVVM or MVC. These patterns dictate a specific naming system. For example, in my project I have classes ...
1
vote
2answers
84 views

Approach for inserting rows

Let's say I have a sale order with multiple rows of products. Multiple users insert rows so I must check for concurrency. In my db the ID of the order and the number of the row makes my record unique. ...
0
votes
2answers
111 views

Is a global context stack a code smell?

I would like to hear arguments for or against a plan I am considering. I have a large network of nodes each of which has vector-valued properties. Accessing these properties (read or write) requires ...
0
votes
3answers
79 views

Design for a function to skip a step if called multiple times

Terrible title, but this is the situation I find myself in often and have not found a good design to make it nice. Lets say I'm working with Javascript and I have an object I am working on that needs ...
1
vote
3answers
77 views

Should a repository or the Login/Register service have an encryption service as a dependency?

I'm designing a simple user login/register program with user login/register and a repository. The passwords for users should be encrypted when stored but I don't know where to put the encryption step ...
1
vote
1answer
219 views

Does anybody still use TODO for writing code later on? [closed]

Statement I often find myself still writing the following statement all over my code: // TODO: (the work that needs done) I do this in order to flag that I need to come back and do something later ...
4
votes
2answers
301 views

What are the practical uses of a neural network?

Even as an outsider to neural network development, they still seem to be a hot topic... I get lots of projects I see being starred on my GitHub homepage relating to neural networks. These projects ...
2
votes
1answer
141 views

Checking preconditions the proper way

I have a class with around 1300 lines and it has many CRUD-like methods that need parameters to be checked, for some of them it's more than just a few rules. For clarity purposes, I am going to use ...
1
vote
0answers
36 views

How to design microservices without leader election but job scheduling?

There is a microservices system that is currently using Zookeeper. Let's assume there is just one type of service A that exhibits a simple read of some value t. However, the one of existing A ...
4
votes
0answers
61 views

Distributed Calculation of Geometric Distance between vectors

I am looking at a large scale low latency way to calculate the geometric distance between vectors. Let's say I have a vector A. It has size 128 and of type 32 bit float. I want to get it's geometric ...
0
votes
1answer
67 views

Controller calling multiple services

I have a few layers in my WebApplication: Presentation, Service, DAO, Domain. Services call DAO objects which reads data from a Database/File whatever. I have a Controller that needs to fetch data ...
2
votes
2answers
175 views

Law of Demeter and its applicability

Let's say I'd like to perform the following command: house.getFloor(0).getWall(WEST).getDoor().getDoorknob(); To avoid a NullPointerException, I'd have to do the following if: if (house != ...
1
vote
1answer
68 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 ...
3
votes
0answers
78 views

Finger Paint path gets huge over time and slows the app

So I am writing a Finger paint app. I have multiple color which user can select. I save the path and paint information inside an array. ArrayList<PaintPath> arrayPaintPath = new ...
1
vote
2answers
113 views

Does it make sense to internationalize logs?

I'm working on converting the logging API used by a web application from log4j to slf4j, and noticed that the interface used to abstract over the log4j implementation supports internationalization; I ...
2
votes
2answers
123 views

Best way to enforce constraints in Class

I have a class, something like this one (C#): public class MyFavoriteClass { public string Name { get; set; } public string Description { get; set; } (...) public ReferencedClass1 ...
1
vote
1answer
46 views

Redesigning a builder to make it reusable

Let's say I have a builder class (which by the way is not techinically a builder, but it's not a factory either) to generate different rules for a game: public class RuleBuilder { private Game ...
1
vote
3answers
112 views

Is separating design from implementation a net win?

In my experience, technical design is made more challenging when it is divorced from implementation, particularly by assigning the roles to different people, because its easy for the designer to ...
6
votes
1answer
92 views

Extracting and generalizing “repeated” methods with similar functionality

Let's say we have a class with many methods that do something different but can be grouped together as one "kind of functionality". For example, adding a configuration o setting rules up. Let's go ...
5
votes
6answers
313 views

Breaking the contract: throw exception or do nothing?

Let's say we have a list of players in our Event class. And we have a dictionary with the score of each player. We can add a score to a player using the addScore method: public class Event { ...
0
votes
3answers
134 views

Should I check for nulls in setters and similar methods?

I have plenty of setters in my classes, as well as many methods to add an item or a set of items to lists or maps. Should I check for nulls for each one of them, or should I allow ...
0
votes
1answer
55 views

Abstract Factories Nesting and DI - Is this acceptable?

I am still trying to get some experience with DI. Let me illustrate my situation and you can give me advice on whether I am using DI and Abstract Factory correctly. I need to create IModels at ...
4
votes
2answers
153 views

How to design an iterable but immutable (read-only) collection

My program models a sport tournament which has one or many events or categories. The class Event has members like players or courts as a List, as well as some dictionaries using the class Map. So far ...
0
votes
0answers
36 views

Looking for pros/cons on using OWIN vs. a simple hand-rolled token based auth

We are wanting to implement an API to be used internally and externally and add it to our solutions. Some environment notes: We are currently using VS2013, .Net 4.5, EF5, SQL2008, MVC4, C#, and ...
-3
votes
1answer
117 views

Returning a variable or a return code from a function

Let assume that we have a main() function in which we call a createDirectory() function. In Python for instance, the code would be: def main(): # Do some stuff createDirectory(myPath) # ...
1
vote
0answers
55 views

Implementing an algorithm for parallel task scheduling

Problem Given a set of applications "A[]" with execution cost "Ex" ,Arrival Time "t", Resource requirements "R" and the system having free resources "Fr", calculate the finishing time of all of the ...
1
vote
2answers
63 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 ...
0
votes
0answers
33 views

DAOs - As a separate package or encapsulated in Service itself?

This question is to understand the pros & cons for keeping the DAO's with the service or as a separate package being consumed by the services. Consider a micro-service architecture. Let's say ...
6
votes
2answers
213 views

Data validation: separated class or not?

When I have a lot of data that needs to be validated, should I create a new class for the sole purpose of validation or should I stick with in-method validation? My particular example contemplates a ...
4
votes
2answers
127 views

Design question about hiding implementation from users of a dynamic library

I'm building a DLL and in my public headers I have this: (definitions are in .cpp but for clarity I show them in .hpp here) ObjectTag.hpp: class API_DLL ObjectTag { public: ObjectTag() : ...
1
vote
1answer
114 views

How to deal with states in front end?

This may sound as a naive question but its bugging me since a long time. I have the following scenario: I have written a new shiny Todo service with my favorite front-end and back-end framework. To ...
16
votes
2answers
1k views

Principle of least astonishment (POLA) and interfaces

A good quarter of a century ago when I was learning C++, I was taught that interfaces should be forgiving and as far as possible not care about the order that methods were called since the consumer ...
2
votes
1answer
53 views

How to design a dynamic thread allocator

Forgive the title if it isn't correct, I am just not sure what I am trying to design is called. Say I have a number of tasks I want to run, N. Additionally, I have a maximum number of threads I can ...
-1
votes
1answer
87 views

Should I re-write VB6 Code to Java [closed]

I work at a mid-sized company where an update is needed to an piece of the application due to an addition to the environment. The part that needs updated has been in place for 13 years, is fairly ...
1
vote
2answers
50 views

One application's methods invoked by many other applications

I have a small Java console application that runs a set of data through an algorithm. Given the size of the data and compute time, I often run 10 to 15 instances of the application, each working on a ...
2
votes
1answer
78 views

Possible DRY with Pausing Mechanism

Background I am currently working on the architecture for a future software design. The design is one long running task (hours-long) with thousands of sequential calls to various libraries. I ...
0
votes
2answers
71 views

What are 'good' cases for subtype overloads

To explain what I mean, I'm going to give an example of a bad case for a subtype overload. Let's say we have a community of people. And depending on what kind people are in our community, our ...
1
vote
0answers
142 views

How to virtualize/sandbox windows games to simulate inputs for each individually?

We are working on a game streaming product in a startup which works really well in its current state. Games can be played over the internet with very low latency on client application. Now there are ...
1
vote
2answers
116 views

MVC - Database search logic in View or Model

Special Note: I asked a very similar question on Stack Overflow, but I have since decided the problem should be solved from a design standpoint rather than an implementation standpoint. I have ...
2
votes
1answer
98 views

Deciding the best way of modeling a timeslot or period of time for a schedule

I am making a sport events scheduler to calculate possible schedules out of initial data and configurations. There are three main domains: players, courts and timeslots. My question regards the ...