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

learn more… | top users | synonyms (1)

0
votes
2answers
49 views

What are some ways to get application settings from users into class objects that also follow proper design principles? [closed]

I'm really confused how to enable the user to apply application settings for an application they are using (that get consumed by to a class object) AND the method I need to use to get the settings ...
4
votes
3answers
84 views

Sets of pair parameters

I have the following class, this class like many rely one parameters coming in as a pair. Originally for convenience, I set them as params Object[] values and check if there is an even number of them ...
0
votes
0answers
28 views

Product Development Design - Customer specific changes [duplicate]

We are developing a web based product that will require customization for various customers. Customers tend to have different rules and nomenclatures, hence the customization requirement. The ...
1
vote
4answers
241 views

How to make one test depend on the results of another test?

Let's say there is a utility class that provides some common static methods used everywhere in your code by many other classes. How would you design your unit tests for the consumers of the utility ...
1
vote
1answer
143 views

Problems with OO design for application with pluggable components

I'm trying to refactor an ugly code and make it easly extendable in the future. The application should be nothing else but a series of components that have input(s) and output(s). The components ...
24
votes
6answers
3k views

When NOT to apply Dependency Inversion?

I am currently trying to figure out SOLID. So Dependency inversion means that any two classes should communicate via interfaces, not directly. E.g. if class A has a method, that expects a pointer to ...
1
vote
0answers
53 views

Should all public API POCO value-type properties be nullables?

I use nullable value types a lot when designing classes that have properties which may remain null, i.e. when the object is being persisted. For example: public int? MyProperty { get; set; } My ...
0
votes
2answers
107 views

Should a “secret access code” use the same security as a normal password? [closed]

Obviously, when you store a password, you should use something similar to bcrypt before you store it in in the database. But I have a client who wants to add the ability to add a "secret code" to ...
6
votes
3answers
254 views

Many small requests vs. few large requests (API Design)

I'm currently working on a project with an organization as follows: Client - Gets data from the main server via REST api. Server - Requests data from various other servers via third-party APIs ...
2
votes
2answers
86 views

Free Standing Functions in Global Namespace

When writing non-member, free functions, can they be placed in the global namespace so long as the signature specifies a namespace-scoped object? For example, in the code below, is "Example 2" ...
30
votes
10answers
6k views

Is it reasonable to assume that any physical quantity can be represented by a 64-bit integer without overflow or underflow?

The original binary search algorithm in the JDK used 32-bit integers and had an overflow bug if (low + high) > INT_MAX ...
1
vote
2answers
103 views

Caveats of using String.hashCode() on a switch on java < 1.7

There are several cases when I want to switch over a String input. I decided for implementing something like: public Object doStuff(String param) { switch (param.hashCode()) { case 1234546: ...
2
votes
5answers
266 views

Is it bad or good to wrap mutable objects in immutable containers?

If I have parts of code that need to mutate the underlying data structure but then others that consume, not mutate the structure, is it good practice to create a wrapper which does not expose mutation ...
1
vote
2answers
93 views

How is a dictionary better than a big switch, when mapping data to action? [duplicate]

Often times we see stuff like that in code: void myFunction(string someValue) { if (someValue == "a") { // ... } else if (someValue == "b") { // ... } else if (someValue == ...
0
votes
1answer
41 views

Separate Drawable objects and their Data

I am looking for a way to design my application. Suppose you had a car drawing thing. Car has multiple parts.Some are going to be visible some are not.For example battery should be drawn. So someone ...
2
votes
1answer
60 views

timed events to modulation of real-time audio

I am new very to audio programming and am having trouble figuring out the right kind of algorithm for converting control events (e.g. like MIDI) to real-time sound genesis with a buffer. At the ...
1
vote
2answers
50 views

Performing data operations that involve separate applications and data sources

I'm designing an enterprise application that produces output based on some input data from another application. In this case, I happen to have also built and thus do control the source application ...
4
votes
1answer
195 views

Should I avoid data duplication?

I'm trying to design a relatively simple ERP system. However, there are some requirements that complicate things a little bit: It must be possible to add all sorts of contacts to the people table, ...
2
votes
2answers
98 views

Typedefs to convey relations between classes

I'm wondering if the following use of typedefs is any good practice, or if there are any downsides to it. Basically I have alot of "data"-structs, which are intended to be used in (globally unique) ...
0
votes
1answer
151 views

Would adding more digits be a way to scale a order generation service? [closed]

I am working on interview questions from Amazon.com Software Development Engineer Intern Interview Questions. One of the interviewees was asked "give a scalable system design of Amazon.com's order ...
0
votes
1answer
132 views

Get inspired by real world objects and their interactions [closed]

Based on this question I think while the aim of OOP is not necessarily to copy real world objects, they could be source of inspiration to design a software or solve a problem or even learn the OOP ...
1
vote
4answers
159 views

Making an automotive system more 'modular' in terms of software?

I am working on an automotive project that we are supposed to make more modular. I am a software guy and I have very little knowledge of automotive hardware.I dont have any requirements or details ...
1
vote
0answers
36 views

what is the best method to return db query and additional information from other methods

I am new to MVC and trying to continue to learn base on best practices. I am trying to return data from multiple sources -- one source being a mysql db query and another source from another method ...
3
votes
1answer
160 views

Event sourcing and REST

I came across Event Sourcing design and I would like to use in an application where a REST client is needed (RESTful to be precise). However I fail to connect these together as REST is quite CRUD-like ...
1
vote
2answers
178 views

Is it possible to avoid SQL injection by not using a Query Language for most tasks? [duplicate]

I'm coming at this from a somewhat beginners viewpoint so if this is an obvious question it's because I didn't know the right terms to search for. Are there DBMS's that provide an alternative ...
2
votes
4answers
280 views

How To Avoid Dependencies between Modules

We have two modules, lets call them U and F. Module U has entities like that: class Upload { Long id; User uploadedBy; Date uploadedAt; } Module F has entities like that: class Field ...
3
votes
1answer
258 views

How would one go about creating a “Licence Key” for a distributable source-available Software project?

This is something I have wondered, it has been a while since I have seen anything you can download which has to connect to license server in order to monetize a piece of software (and the last time I ...
1
vote
2answers
141 views

Which design (pattern) would be suitable to abstract logging platforms?

I need to create a simple system to abstract logging platforms. The idea is that I'd like to be able to exchange or activate a logging platform (nlog, log4net, enterprise library) via some ...
1
vote
0answers
51 views

Help design this data import program

I want to import some data from various locations and pump it into MongoDb and some cloud services. The data starts off as JSON, I read that JSON, create some objects in mongo, go to the next level ...
0
votes
1answer
60 views

Design caching system

I am thinking about making my own caching system, mainly for C#, but this is more a design question, so the language doesn't really matter. Let me start at the beginning, I have a basic web api, ...
0
votes
2answers
31 views

Making sure loaden (non default) config is valid

I'm writing a device Software in which the device must handle much data. Therefore it has a database, either on NV-Ram (Non-volatile memory) or a SD-Card. Due there's a DB which I can use, I also use ...
0
votes
2answers
105 views

Organizing C++ Components [closed]

In my current company we've brought the discussion about how to organize most of our different C++ components considering the following requirements: There might be interdependencies between ...
1
vote
2answers
467 views

REST API - Should API Return Nested JSON Objects?

When it comes to JSON APIs is it good practice to flatten out responses and avoid nested JSON objects? As an example lets say we have an API similar to IMDb but for video games. There are a couple ...
0
votes
1answer
75 views

Should I prefer classes or singletons in JavaScript/Node?

This question applies especially to Node.js, but also to JavaScript in general. I started working on a simple web app in Node.js. I'm relatively new to Node and JavaScript, and come mainly from C# ...
15
votes
3answers
1k views

How much detail to put into first iteration of project?

I have just started a new personal project (Python), and am writing what amounts to a "rough draft" of the program, the minimum required to do what I want to do. I am not yet putting in extensive ...
1
vote
0answers
42 views

Designing an Action abstract class with GUI

I have an Action class, where an Action can do a range of things, including: Performing a sequential list of other actions Performing an action if a condition is true Allowing the user to pick ...
1
vote
1answer
85 views

IoC invalidation

I have a bunch of services that get registered as singletons by my IoC container on startup, all of these services have a constructor which takes in a connection string which is used by the underlying ...
1
vote
2answers
102 views

Use Case Diagram. Can a system be its own actor?

Hello I got the definition below for an actor. That means the system cannot be an actor to itself. I was wondering what if the system is supposed to display certain elements on a screeen. In that case ...
12
votes
4answers
805 views

“Use map instead of class to represent data” -Rich Hickey

In this video by Rich Hickey, the Clojure creator, he advises to use map to represent data instead of using a class to represent it, as done in Java. I don't understand how it can be better, since how ...
0
votes
2answers
164 views

In what case a use case should be written

I am trying to figure out some questions to help me decide whether a use case should be written for that requirement or not. Is it neccesesary to have a use case for each requirement? E.g I have ...
22
votes
3answers
1k views

Caching at business layer vs Caching at Data Layer

I have always worked on projects where caching was done on DAL, basically just when you are about to make the call to database, it checks if data is already there in the cache and if it is, it just ...
0
votes
1answer
63 views

Beginner's UnitTests for MVP Presenter class

In my application, I have a user settings form with roughly 20 checkboxes and a few other controls. The checked state, enabled state and texts of these controls are bound to about 60 properties of the ...
1
vote
3answers
157 views

Is self referencing tables a good idea for geographical data?

I am creating a design for different Geographical types where each type is just a little "place holder" in over all heirarchy. One example is Zip code Belongs to Territory Belongs to District ...
4
votes
1answer
212 views

Should I be using separate 'domain' layer?

I have been reading a lot about domain layer and DDD. However I am still confused about it. To me they seem to be a fancy name for business classes however more modelled towards your application ...
1
vote
0answers
31 views

Are Serverlet Containers' Characteristics Against Scalability and Fault-Tolerance of a Web Application?

We most likely deploy a JVM-based Web application (e.g., Scala) on a container (e.g., TOMCAT, Jetty, etc.). Does the following points about a serverlet container goes against us to create a scalable ...
3
votes
4answers
345 views

YAGNI principle put to practice

I recently came across to this principle and so far it is clear the fact that doing things that you don't need at the moment is not feasible as they might not be used or might be changed. That being ...
1
vote
6answers
219 views

What is a better design a light weight user or a heavy weight heavy user model?

This is a design question and I am confused about how to design my user object. As in most systems, user is the central part of my application and a lot of information scattered around my database ...
1
vote
2answers
67 views

Define Interface Simplicity vs Implementation Simplicity

In Richard Gabriel's The Rise of "Worse is Better", he talks about the simplicity of interface vs the simplicity of implementation in a design. I've never been able to quite grasp what he means and ...
2
votes
3answers
223 views

How to implement the repository pattern for an app that will change its database from sql to nosql on in couple of years?

I have been reading a lot about repository implementation. I am confused about which way to implement it for a project I am sure would change its data layer methods because of db migration from MS Sql ...
14
votes
4answers
1k views

How does one keep argument counts low and still keep third party dependencies separate?

I use a third party library. They pass me a POJO that, for our intents and purposes, is probably implemented like this: public class OurData { private String foo; private String bar; private ...