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

learn more… | top users | synonyms (1)

2
votes
3answers
407 views

Is `isNaN`' a bad design or a has-to-be design with tradeoffs?

My first programming language is python. And recently I'm learning C and javascript. In javascript, there is a design which confused me a lot, default the function isNaN. Put aside its weird ...
0
votes
1answer
89 views

Function or class design in library API for efficient object reuse

I am currently building a library in C++11, where I spent a lot of time trying to design a good interface. After some small redesigns along the way, I've ended up with a design that I am happy with. ...
1
vote
3answers
82 views

Inheritance or type field when designing class

I have to model a store with all kinds of articles. The user has to be able to filter these articles by type, price, ... . The store would contain a list of Article objects. I've been stuck on ...
0
votes
0answers
87 views

How to improve the design pattern of this Screen Window system?

I have a Screen Window system, a Screen (IScreen as interface), which holds a window, either WindowA or WindowB. System can switch window by calling stateChanged: class IScreen{ public: virtual ...
2
votes
2answers
98 views

Designing voucher system in e-commerce application

I'm currently designing voucher system to be implemented in our company e-commerce application. I'm currently have voucher table in database which contains following information : Unique voucher ...
2
votes
2answers
69 views

Design architecture advice on relation between objects and singleton JS

I would like your feedback regarding some best practices on design relationship between objects, specially when a singleton object is involved. Let's imagine I need to simulate a Shop with ...
0
votes
1answer
84 views

Where is the appropriate place to put application configuration files for each popular operating system? [duplicate]

Before writing this question, I'd like to state that I use Linux on a daily basis, which is why I'm creating this post to extend my knowledge of the other main operating systems I'm concerned about, ...
7
votes
2answers
2k views

how to refactor many singletons

I have a medium-sized python program (~5000 lines of code), which I've built up over time, with no particular plan as I went ahead. The architecture I've ended up with consists of 5-6 large Singleton ...
1
vote
2answers
484 views

C# .NET MVVM software architecture and naming conventions

I am currently working on a software using C# .NET and WPF with the MVVM pattern. Though the software is almost done, I have been discussing our architecture for a long time and I would like to get ...
0
votes
2answers
270 views

Does algorithm design belong to software engineering? [closed]

In academic meaning, it seems to me that algorithm design is studied in a high/abstract level of computation (computability, complexity), although software engineering is also studied in ...
8
votes
1answer
316 views

Are Windows 10 app services only useful in enterprise environments?

I have been following one of the capabilities Microsoft introduced for the Universal Windows Platform (UWP), namely app services. An app can now provide a service in the form of a background task that ...
0
votes
0answers
17 views

How to organize enterprise software in Git [duplicate]

I'm running into a conceptual design dilemma with our enterprise software. I'm hoping someone on here can help point me in the right direction. We have many different applications: Three Windows ...
0
votes
2answers
91 views

Should public API classes have helper methods that provide anticipated functionality?

For the purposes of providing a concrete example for my question, let's say I'm building an API that provides access to an email system and contains a set of public classes e.g. Mailbox, ...
0
votes
1answer
53 views

How to write loosely coupled tests [duplicate]

I work on a software that has a lot of tests. However, instead of helping us develop faster, these tests actually bog us down, because even tiny changes in the application break many tests. Clearly, ...
3
votes
1answer
108 views

How to write a simplistic functional test plan?

I was given an assignment and it is fairly simple, just a special type of search for a special type of objects. However, I was told to implement a set of functional tests and also provide a 1 page ...
3
votes
3answers
118 views

Deleting a domain object and ensuring any remaining references are subsequently unusable

If I have a domain class with an instance method Delete(). What is the best way to ensure that any leftover references to an instance that has "deleted itself" are subsequently unusable? This ...
1
vote
0answers
107 views

ASP.Net MVC - Implementing a Test Environment

I would like to implement some sort of test environment for ASP.Net projects. I am trying to implement this as an alternative to mocking the entity framework. Here is what I am trying to achieve : ...
0
votes
0answers
28 views

Modeling token generation on OAuth2 for two different users

I have an OAuth2 implementation that works with the authorization_code flow. As per an implicit relationship, one kind of user (Alice) is able to retrieve tokens for the other (Bob). On the RFC it ...
2
votes
1answer
91 views

How to best futureproof frontend code as server response evolves?

I find that in the early stages of a project the structure of the data returned by the server can change quite frequently as the data model changes. For example, if I'm building an application that ...
0
votes
1answer
206 views

How to avoid LazyInitializationException using Hibernate and Jersey

I am working with Spring Boot + Jersey + JPA/Hibernate to build a RESTful API. The issue I am encountering right now is when I have a relationship in my JPA Entity that is lazy loaded I get a lazy ...
2
votes
3answers
94 views

How can I architect P2P discovery?

I've never really done network programming so this is all new to me. What I'm attempting to make is a Peer to Peer "chat" client. The idea is that anyone can connect to someone whose IP they know. All ...
8
votes
2answers
243 views

How do I store multiple views of data in memory?

I have a bunch of modules. I can break these modules into different categories that are complete and do not overlap. For example, three categories, with ids that can be expressed as Animal, Vegetable, ...
2
votes
1answer
51 views

Instance methods that modify multiple objects

I'm currently in the process of rewriting an older library for managing documents. I'm having difficulties to specify an interface for the management of links between those documents. Previously they ...
4
votes
4answers
208 views

Should exceptions be raised higher up or lower down or both? [closed]

When calling some function in a Python application, the function often calls functions deeper down which again call functions deeper down, etc. It is easy to unknowlingly pass a bad value to the ...
5
votes
8answers
299 views

Designing around shallow constness with inheritance

Background I'm writing an image handling class. For this question two requirements of the class are of interest: Must have "deep" const correctness. Must allow sub-image aliases, a.k.a. sections or ...
1
vote
1answer
94 views

Stuck on design when attempting to create an object store

I'm working on a small scale API project but as it will be used and maintained by people that are not Software Engineers to trade I am attempting to keep the design as separate and identifiable as ...
1
vote
2answers
443 views

How to solve this inheritance problem

I have the following classes: public abstract class StaticFileController<File, QueryData> : AsyncController { private string _resourceName; public StaticFileController(string ...
2
votes
1answer
190 views

How do you calculate affinity in Edge Rank/Activity Streams

I have been researching how to build a newsfeed that sorts the order by relevancy. I have been following along Facebook's Edge Rank and Etsy's Activity Feed Architecture and I can't figure out how ...
0
votes
1answer
104 views

Finite Element Shader

I am working on a geometric wrapper for a space jet exhaust impingement solver. A key part of the solution is determining what the jet can "see" and therefore hit. My model is grouped with nodes or ...
12
votes
3answers
775 views

How to draw programmer's attentions in certain conditions?

Let's start with an example. Let's say, I have a method called export that depends heavily on the DB schema. And by “depends heavily” I mean I know that adding a new column to a certain table often ...
1
vote
0answers
141 views

What is a good name for functions like 'sum', 'max', 'min'? [closed]

Suppose you have a function that allows you to find the sum/minimum/maximum of a data field: void g(DataField* d, Operation* op){ // applies op->f(...) on all fields of d } Operation would be ...
1
vote
1answer
55 views

Threads Inside Full Duplex Device Library

This is the second project I'm working on which will use a design that I'm not 100% confident about. I'd like some feedback, maybe recommendations for a better design, or verification that this would ...
1
vote
1answer
217 views

Code First Approach and Business Classes Validation

I have a solution split into two projects : A class library containing all of my model classes (lets call it Business), and an ASP.Net MVC project. My Business classes are meant to be generic and ...
6
votes
3answers
257 views

Is mutually referencing classes a consequence of bad design? [closed]

I am currently working on a small game I did in about ten days. Since I am programming for myself, I am being lazy and going to the easiest solution with (too) little concern about bad code quality. ...
1
vote
1answer
45 views

Preventing unauthorized writing to parts of server [closed]

Say I have two members which share a server. Both members have a game that is accessible to anyone and after playing, it records high scores by sending a request to write to a file on the server. ...
2
votes
2answers
147 views

Upgrade and downgrade customers subscription

I have been stuck at a requirement for way too long too handle it :(. Our company is having increased number of customers who wants to upgrade or downgrade their subscription. For now, the ...
3
votes
3answers
91 views

How to design access to different type objects in protocol response

I have written a communication library for an industrial device protocol. The response frame contains a byte array as payload data. The payload data consists of several "objects“ of different types, ...
2
votes
5answers
175 views

Creating variations of a property heavy class

What kind of pattern or design can prevent the creation of a class packed with properties that aren't always used? Example class Car{ public string type; public string name; public DateTime ...
4
votes
1answer
133 views

Better to have two variables to designate whether a variable exists, or one

Lets say I have a string variable FirstName. FirstName can be null. I need to know if FirstName exists or not. Is it better to just use one variable: FirstName and if FirstName is empty assume that ...
1
vote
1answer
219 views

Multi-tenant database design

My boss is currently working on a database design for a multi-tenant capable ERP/CRM system, which will have a Sql Server backend. Some key points of the design: A server instance will host a ...
1
vote
2answers
103 views

How to achieve inheritance when using just modules and vanilla functions in Python?

Python doesn't enforce any paradigm. It gives you freedom. Python provides encapsulation at module level. If I have a module A and have a module B with same interface. How do I sort of inherit B ...
2
votes
2answers
102 views

How to accomplish a task of evaluating editable variables and formulas, using PHP?

Task as defined: User needs to be able to define their own variables and formulas to operate on those variables, to get output based on their inputs. Since formulas and variables and their inputs ...
7
votes
3answers
441 views

C++ Header files design : just like defining an API?

I'm kind of new to large scale software development in C++, and I was wondering on the design side of things. I was reading this question, and I thought that, overall, once we get past constant ...
2
votes
1answer
148 views

Common Repository design

What I have: I am developing an Active Directory layer which will be used by a huge application with several modules having several solutions and projects... I am fairly new to developing large ...
5
votes
5answers
628 views

Debug function input vs expecting code users to read the documentation - How far do I go? [duplicate]

I could write an endless amount of debugging code to handle the various components of input for a function, check that the correct data types are used, make sure things are decendants of the proper ...
1
vote
1answer
59 views

MVC .NET APP Program Structure [closed]

I am just building a MVC .NET application, eventually this will use entity framework and the repository pattern to structure the program. The first release however will only be calling other jobs that ...
1
vote
1answer
38 views

Deploying and maintaining a script on customer's domains

I am trying to figure the best way (or just the pros and cons of various options) for delivering a service via a script which runs on the customer's site (think Google Analytics). Unlike Google ...
2
votes
4answers
243 views

Why shouldn't pure functions always be static and public? [duplicate]

What are the reasons, technical or otherwise, that pure functions (functions which do not rely on external state and have no side effects) should not always be public and static? When a static and ...
2
votes
2answers
320 views

How is encapsulation broken by getters/setters, even when using MVC model [duplicate]

I was thinking about encapsulation in Java and then I thought how getters/setters break encapsulation. After I went through this , I saw many recommendations like to avoid getters/setters on fields ...
0
votes
3answers
223 views

Forcing Cache Refresh

I'm updating an existing tomcat web application to read certain resources from a REST API. Currently the application reads them from flat files. Since the application is very critical, I added a ...