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

learn more… | top users | synonyms (1)

1
vote
1answer
60 views

My web app uses a number of photo hosting APIs. What would be an effective database design to store their limitations?

For the sake of an example, let's say I'm using Picasa, Flickr and 500px APIs, and that each of the services has limitations on these simplified parameters: overall account space individual file ...
-1
votes
0answers
93 views

How to implement “invite a friend” workflow?

I am developing a service and to increase the growth I'd like to implement a customer referral program. This means a customer can send an "invite" and get points if his invitees accept the ...
2
votes
1answer
69 views

How to handle error opening Windows file created by my code

My Windows desktop app creates a file in: %LOCALAPPDATA%\XYZZY Software\Our Product\foobar.json One customer on Windows 7 is experiencing "Accessed Denied" errors when our software tries to ...
81
votes
8answers
13k views

What is “Soft Coding”, really?

In this article by Alex Papadimoulis, you can see this snippet: private void attachSupplementalDocuments() { if (stateCode == "AZ" || stateCode == "TX") { //SR008-04X/I are always required in ...
2
votes
5answers
234 views

Constructor overloading or allow null?

Which is the preferred design to use, one constructor that allows null, or two constructors where one throws an ArgumentNullException on null? Two constructors with exception throwing public class ...
1
vote
0answers
23 views

Create unique buckets for stream of entities based on constraints on the entity attributes

I have stream (magnitude 10s of millions) of entities, say Item which is modeled as below: class Item { String id; Double price; Double profitPercentage; Country originCountry; Country ...
-1
votes
0answers
33 views

Is making a public network of Node.js nodes feasible?

I want to create a public IP network that consists of many different “JavaScript nodes,” all running Node.js. Each node would be on a server with a specific IP address, and would run on an assigned ...
0
votes
0answers
43 views

How to save the differences between objects which are the result of random changes?

I keep a state object of the following form: class State { int num1, num2; List<String> strings; MyObject myObject; // A class I wrote // etc. } The state changes many times ...
2
votes
4answers
227 views

Are static global variables as bad as global variables? How to avoid using them?

In general, I know that global variables are bad and their should be avoided. Are static global variables equally bad? In all my projects, I have heavily relied on static global variables. From ...
2
votes
1answer
133 views

REST api design: How to manage multiple type of resources in URL?

Lets say I have an Organization and Users inside that organization. To get a user in particular organization what should be the GET request url from below options? 1. ...
0
votes
1answer
48 views

Mapping match-up combinations into an integer

First of all, I want to say I wasn't sure if I should post this here or in math.stackexchange but I think the question is too programming-related to belong to the latter community. Definetly not a SO ...
0
votes
0answers
52 views

Design of thread pool reuse with Executors.newFixedThreadPool in Java [migrated]

In my application I have a code, which should run every hour on a new items and execute some expensive operation with multi threading. Code fragment: int i = 1; //noinspection InfiniteLoopStatement ...
5
votes
3answers
144 views

Can I implement a payment feature in my own software?

Note: I spent some time thinking about this question before choosing which StackExchance site to post it on. I have decided on this domain because of the description: "For professional programmers ...
5
votes
3answers
382 views

Is it ok to have a class that only has boolean properties?

Scenario We have a class Vehicle, this class contains some properties to define the object such as a CarBrand, TransmissionType, Color, etc.. A car (vehicle) also has options, these days a lot of ...
-4
votes
0answers
55 views

How to design a REST API client?

I recently started to develop a client library for Bondora's REST API in ruby. As this is my first project of this kind, I was wondering what the common functionality and design of such a library ...
42
votes
6answers
2k views

Business logic: Database vs code [duplicate]

I'm a student of systems engineering, and all my teachers and friends (that actually work in the area) say that it is better to have as much logic as possible implemented in the database (queries, ...
6
votes
2answers
164 views

MVP (Supervising Controller) Does the view update the model?

I've been reading about MVP, specifically Supervising Controller. One thing I'm having difficulty wrapping my head around is how the View interacts with the Model. It was my understanding that the ...
2
votes
2answers
162 views

What is a good approach to get a detailed system design from an existing system?

I will be working on a system which will be ported over from Java to .Net. It is a pretty big system. I don't have any specifics about how the system is designed, no documentation, nothing. You know ...
1
vote
2answers
66 views

Prevent creation of multiple entities

In an application I'm developing we have integrated with a third party api. One of the use cases consists of a user of our system filling out a form and submitting it. This results in us mapping the ...
6
votes
1answer
97 views

How to allow for custom Rules in a Entity Component System designed game engine?

So I've been doing a lot of research into game engines, and Entity Component System (ECS) seems to be the most flexible and extendable design to use. Just to summarize, in ECS the basic idea is that ...
0
votes
0answers
20 views

Where to store authentication/authorization entities with respect to crosscuting concerns?

Can you explain me how and where to store authentication/authorization entities in project structure. For example I have 4 projects in my solution in Visual Studio: SolutionName.WebApp ...
3
votes
1answer
147 views

What is the most sensible design for making files available for download from a URL?

This is what I need to do, in a nutshell: Generate Excel spreadsheet files (programmatically). Store these .xlsx files in a location where they can be accessed by users later. These files need to ...
2
votes
0answers
47 views

Are there any generic algorithims or Python functions to help find the longest item in a JSON document?

I am trying to log a JSON error message to Google's Cloud Logging platform. Unfortunately, the maximum size message you can log is 8000 bytes and some of the JSON documents I want to log are larger ...
2
votes
1answer
76 views

How to to design a cronjob-like requirement

I have to design a system where I need to make some processing (which might take say 10 mins). After some amount of time (say 30 mins), I need to come back and check the status of this processing ...
4
votes
1answer
51 views

What is the best pattern to define own type with definitive collection of values?

I want to define own data type, say a Digit, which would have definite type of values ( 0 to 9 ) and I'm struggling with defining this in a way it's practical. What's the best way (design pattern) to ...
4
votes
1answer
73 views

Boolean endpoint within a RESTful API

I am currently designing a JSON RESTful API which should have a boolean endpoint such as /item/vote which can either be false meaning that a user has not voted for a specific item or true meaning that ...
2
votes
2answers
148 views

Reversible Functions

Currently writing a JSON Importer and creating some POJOs based on the data. I also have a requirement to write an JSON Exporter which take the information in the POJOs and exports a JSON doc. To me ...
4
votes
1answer
151 views

Am I using the factory method design pattern correctly, or which creational pattern should I use?

I've been studying creational design patterns for the past week or so because I have a common use case that keeps coming up, and I can't figure out which pattern fits the bill. Here is a simplified ...
1
vote
0answers
61 views

Downloading information, but just when needed

I'm struggling with thinking of how to implement the following (in java): I try to create a program, that displays information about lots of tv series. For this i use the website "Burning Series" ...
7
votes
1answer
150 views

Code Design: Delegation of arbitrary functions

On PPCG, we frequently have King of the Hill challenges, which pit different code bots against each other. We don't like limiting these challenges to a single language, so we do cross-platform ...
2
votes
4answers
118 views

Are names like OrderCreation and UserRegistration suitable names for business logic / domain classes

We have moved to a more SRP model and found coming up with class names challenging. Previously we had a Order class that looked something like this: public class Order { public void Create() ...
3
votes
4answers
228 views

Is Template Pattern a good way to implement DRY?

Here is my problem: I have and class structure like this: class Base { private: SomeType something; bool isSomeValue; public: virtual void myMethod() = 0; ...
0
votes
0answers
69 views

Should we add an extra class to this code sample

I have a shopping website which allows users to place orders. In my web application when the users click 'Create Order' i call an OrderService class which looks like the below: public class ...
1
vote
1answer
58 views

«Heavy» object initialization: within each thread or outside and then pass it to the threads as parameter?

Let say there is an array of strings, I have to process. I'm using a «heavy» third-part object which gets the string and performs its analysis. In order to optimize a performance, I create a number of ...
0
votes
0answers
15 views

Rightness of reducing dependencies by grouping them for an application

This question is not technology specific althought a technology specific answer is welcome. Furthermore i'm asking about a design problem for an application which have (in my opinion) not the same ...
5
votes
3answers
139 views

What is a better design for exposing information in a bug tracking system?

We're working on a BugTracking system and are still in the learning process. A BugReport has a title, description, (...) and also a tag. A tag represents the progess of the BugReport, e.g. New : ...
7
votes
4answers
357 views

How to save a list of strings which might grow too large but old data is not useful

I am developing an application which sends certain notifications to the user as read from a read-only external service. The user might dismiss notifications, and those should not appear again. I ...
0
votes
5answers
386 views

How is it possible to log a user into a system with billions of similar data without delay?

Taking for instance Google mail and Facebook, they both have a huge database of users. It would be easy to search through a database of 100 similar logins and find a match in a second, but not in the ...
1
vote
1answer
162 views

What could be the better c# design for following requirement? [closed]

I am working on creating a c# design for following requirement. I am creating this for a fitness website. I have an article (as Text) and a exercise (as Image or Videos) as the base entity. Now i ...
1
vote
1answer
75 views

Architecting a middle-tier enterprise system

I am a software developer with limited exposure to designing larger systems. I am interested in determining some common techniques, maybe even common diagrams, to help me complete the design of a ...
2
votes
1answer
83 views

How do I model similar types that have different data?

We're working on a bugtracking system. Our design has a BugReport class that represents the filing of a bug of some Project in the system. BugReports have tags, representing the state/progress of the ...
1
vote
3answers
81 views

Data Flow Diagrams _ context diagrams

how to show delete operation in dfd context diagram? I want to show the following action. "Administrator remove and add users to the system" Since context diagram contains just inputs and ...
1
vote
1answer
85 views

.NET Implementation Question (repository access)

I am trying to write a generic method which goes a particular DB table depending on the entity which is passed (all valid entities implement IStaticData) : IEnumerable<T> ...
2
votes
0answers
93 views

How should I represent to-be binary data?

I'm writing some serialization code, and I'm wondering how to deal with binary data. As I'm doing it in Python, my goal is to make it very simple, not require a lot of programmer overhead, etc. Three ...
1
vote
2answers
103 views

How to implement application that will connect to server allowing the server to request data

I'm not sure what to title this question or if this is the right place to ask it. After Googling and continually coming up empty, I'm turning here as a last resort. I've developed a SAAS web ...
0
votes
1answer
59 views

Change stock calculation depending on warehouse

I have a currently-existing stock management dashboard. The user selects a warehouse, and it displays the current stock in this warehouse. The stock management teams wants to display a date, ...
4
votes
3answers
150 views

Transitioning from C++ multithreading to Java multithreading

In C++, I've been accustomed to using threads in the following way: #include <iostream> #include <thread> #include <mutex> std::mutex m; int i = 0; void ...
-2
votes
2answers
89 views

Where can I find software project deliverables/ documents to help me professionally document my projects? [closed]

Hie guys. I have never been employed in the software development industry and when I do projects I usually just draw non-standard diagrams or used use case diagrams and class diagrams. This time a ...
4
votes
3answers
67 views

Using Multiple 'Sub-types' vs a larger single type?

I have a user model in an application that I'm working on, which currently uses sub-types to encapsulate properties depending on what type of user you are - I just can't help but think that this is ...
7
votes
1answer
185 views

Should I use a Status field or rely on calculations?

A bit long, but the overall the question is: Should I have a status field in the table, or should I calculate the status in-memory from other information in the record? What are the pro/cons of ...