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

learn more… | top users | synonyms (1)

1
vote
2answers
105 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 ...
16
votes
2answers
2k 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 ...
82
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
2answers
711 views

Is it possible to migrate struts/spring based application to GWT?

I am using the combination of spring, spring-security, struts and iBatis in my application. Now I am looking to migrate the struts UI to GWT. The new combination must be spring, spring-security, GWT ...
4
votes
3answers
312 views

Does the visitor pattern violate the Liskov Substitution Principle

When using the Visitor pattern, I have observed the following: The visitor has weak dependencies to concrete types (each visit method has the concrete element as a parameter or is a method that ...
28
votes
9answers
2k views

Design for future changes or solve the problem at hand [closed]

While writing the code or during design do you try to generalize the problem at the first instance itself or try to solve that very specific problem. I am asking this because trying to generalize the ...
4
votes
2answers
1k views

Confusion with Factory pattern regarding Liskov's Substitution Principle, code maintainability and Unit Testing?

I have a confusion regarding Factory Pattern there are basically two ways You can implement that. Approach 1: public interface IProductFactory { IProduct GetProductA(); IProduct GetProductB()...
2
votes
1answer
57 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 ...
3
votes
2answers
523 views

Does this Decorator implementation violate the Liskov Substitution Principle?

Please consider the following implementation of the Decorator design pattern: WordBank objects store strings and return them to the client through the method getWords(). The decorator class, ...
27
votes
10answers
6k views

Should a view and a model communicate or not?

According to the wikipedia page for the MVC architecture, the view is free to be notified by the model, and is also free to query the model about its current state. However, according to Paul Hegarty'...
-1
votes
1answer
93 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 ...
2
votes
1answer
80 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 ...
4
votes
2answers
95 views

Go - idioms/design for determining when an unknown number of goroutines are complete

I have a workflow wherein I walk recursively through a bunch of directories, then for each file perform some action. I'm using goroutines to walk each directory, and also to process each file. The ...
39
votes
10answers
4k views

Be liberal in what you accept… or not?

[Disclaimer: this question is subjective, but I would prefer getting answers backed by facts and/or reflexions] I think everyone knows about the Robustness Principle, usually summed up by Postel's ...
46
votes
9answers
7k views

Code Smell: Inheritance Abuse [duplicate]

It's been generally accepted in the OO community that one should "favor composition over inheritance". On the other hand, inheritance does provide both polymorphism and a straightforward, terse way of ...
3
votes
2answers
411 views

Preventing Liskov Substitution violation

I am reimplementing some component and noticed that the original version has a Liskov Substitution violation. It's not all that critical, though I'd like to get rid of it in the new implementation . ...
0
votes
2answers
73 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
2answers
144 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 ...
1
vote
0answers
145 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 ...
2
votes
1answer
124 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 latter....
1
vote
1answer
62 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 ...
2
votes
1answer
71 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 ...
2
votes
5answers
249 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
24 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 ...
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 ...
5
votes
3answers
395 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 ...
17
votes
2answers
18k views

best practices for NoSQL database design

I have just started using a NoSQL document based database (MongoDB) and i'm curious about the best practices for designing databases. I presume the architecture should be different from relational ...
6
votes
2answers
232 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
1answer
143 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. /api/organization/:orgId/users/:...
43
votes
6answers
3k 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, ...
5
votes
3answers
156 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 ...
3
votes
1answer
167 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 ...
25
votes
8answers
32k views

What software can be used to create architecture diagrams? [closed]

I use MS Visio for most of my design/architecting work when I need to be able to save the diagram somewhere and edit it later. I'm not the biggest fan of Visio, but it gets the job done (and it's free ...
2
votes
2answers
150 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 ...
1
vote
2answers
70 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
106 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 ...
2
votes
2answers
302 views

Modeling a multi-channel communication device in C#

Background We (my coworkers and I) are architecting a high level C# API to interact with a hardware device's native Windows DLL. First I will discuss the hardware-architecture, then get to the ...
7
votes
4answers
358 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
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 SolutionName....
2
votes
0answers
52 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
83 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
53 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 ...
10
votes
4answers
13k views

Generic file parser design in Java using the Strategy pattern

I am working on a product in which the responsibility of one of the modules is to parse XML files and dump the required content in a database. Even though the present requirement is only to parse XML ...
4
votes
1answer
210 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 ...
1
vote
7answers
448 views

How to encourage creative user interface design?

When I picture a really well functioning software team in my mind, one of the visions I have is of a developer showing off to a small group of devs some cool, clever UI that they just came up with ...
4
votes
3answers
159 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 makeACallFromPhoneBooth()...
4
votes
1answer
173 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
62 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" (...
73
votes
14answers
30k views

What is the ideal length of a method for you? [closed]

In object-oriented programming, there is of course no exact rule on the maximum length of a method , but I still found these two quotes somewhat contradicting each other, so I would like to hear what ...
2
votes
4answers
125 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() {...