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

learn more… | top users | synonyms (1)

0
votes
2answers
42 views

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

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
74 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
25 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
1answer
86 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
109 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 ...
0
votes
0answers
28 views

Best Practices for Managing Low Disc Space [on hold]

What are the norms for managing a low disc space situation? i.e. what should my application do if there is low disc space on startup? What would an application normally do if it runs out of space ...
-3
votes
0answers
37 views

Initiating to Implement a New Idea [on hold]

I have a new idea, which I think in a way would work well, I have been working as a Java Developer since past few years, I also have a good knowledge on design patterns and data structures which are ...
20
votes
6answers
2k 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 ...
0
votes
0answers
47 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
100 views

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

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 ...
2
votes
1answer
93 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
75 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" ...
0
votes
0answers
23 views

How to implement a Web UI feature to insert default scentences in an textarea [migrated]

We are talking about implementing a system that easily generates sales reports for our salesemployees. We want to create a webapplication with one or maybe more textarea's to gather the inputdata from ...
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 ...
-2
votes
0answers
39 views

Designing OOD for Secure User Login with Securely keeping session [on hold]

I am planning to design a module from my project which is having let User login securely and keep the session alive securely on a machine accepted by user as frequently used machine. I have identified ...
0
votes
0answers
37 views

What classes should be part of Business Logic Layer? [closed]

I am very new to software architecture.I am developing an iPhone app. I have read that iOS follows MVC architecture, but one of my previous projects had busies logic layer, helper folder too in its ...
1
vote
2answers
96 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
0answers
48 views

Programming thought experiments [closed]

I hope this question is allowed here, if not please delete or move! Last year a colleague mentioned the 'Two Generals' thought experiment to me which has stuck in my mind ever since, especially as I ...
2
votes
5answers
250 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 ...
0
votes
2answers
83 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
35 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
57 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
37 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 ...
0
votes
1answer
35 views

Project type for a matching application to run on schedule [closed]

I am about to start work on a new project, and I am looking for some advice on what approach I should take in terms of what kind of project it should be. Basic overview of requirements The system is ...
-4
votes
0answers
56 views

Interview question for designing a timer system [closed]

The question is like below. There are multiple (can be in 1000s of number) servers which can send a request to the times (class/system) running on a specific port, when they require. The request is ...
4
votes
1answer
188 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
90 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
115 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
127 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
154 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 ...
0
votes
0answers
32 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
132 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
173 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
275 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
249 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
120 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 ...
0
votes
0answers
49 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
51 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
102 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 ...
0
votes
0answers
38 views

How to profile and compare two client-side approaches? [closed]

I'm facing a project in which presumably large datasets will be interactively visualized client-side. These datasets' sizes vary, both in number of rows and number of columns. The visualizations and ...
0
votes
2answers
293 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
67 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 ...
0
votes
0answers
34 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
49 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
81 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
751 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
158 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 ...
21
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 ...