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

learn more… | top users | synonyms (1)

-1
votes
2answers
87 views

Advantages of these recommendations in ooprogramming using Java

Below are the recommendation from section 5.1 of this essay. While Java is not a pure object-oriented language, it is possible to program in a pure object-oriented style by obeying the following ...
-1
votes
2answers
152 views

Why List<E> interface is additionally introduced in collection hierarchy?

Below is the diagram, where, if we just consider the implementations of List, AbstractList maintains the core behavior of list. To introduce the new implementation class MyList(say) one can ...
0
votes
1answer
33 views

How to implement a NavigationManager class without using singleton pattern

I'm practicing on writing testable code. One problem I have ran to (researched a lot too) is singleton pattern. It's global state nature makes it unreliable to test because singleton's property ...
3
votes
3answers
134 views

What is business logic code and what is data access code, and what's the difference?

I ask this because it seems people usually consider the code that goes into a DAO or Repository implementation as "data access code", while the code that directly uses these DAOs/Repositories as ...
1
vote
1answer
65 views

What's the quickest and most maintainable way to implement SQL querying of disparate C++ variables?

I've recently joined a team working on radar observations. The team has access to a repository of software (written in C++) used for dealing with these observations, but their work is focused towards ...
4
votes
2answers
123 views

What is a good design for allowing backwards compatibility of files between different versions of software?

What is a good design for allowing backwards compatibility of a file type between different versions of software? For instance, how does microsoft get word 2007, 2010 and 2013 etc... to all open docx ...
1
vote
3answers
72 views

Using delegates to avoid duplicate creation of resources

I'm writing a PCL that uses an HttpClient to go visit a few sites and extract data from them. My initial code looked like this: public static class Download { public async static ...
3
votes
1answer
75 views

Creating an interface just to decouple from third party libraries

I'm currently developing the Authorization module on a framework of mine. I have the following class so far: public interface IAuthorizationManager<C> where C : ...
75
votes
12answers
9k views

Is testable code better code? [duplicate]

I'm attempting to get into the habit of writing unit tests regularly with my code, but I've read that first it's important to write testable code. This question touches on SOLID principles of writing ...
2
votes
1answer
88 views

Python Classes and Design Questions

What is the best way to design a class to see if an update occurs on a property? I have a whole bunch of classes, and current am going through a re-design of the python package I created. ...
6
votes
1answer
146 views

IoC/DI design for class library

I am refactoring and introducing unit tests in a large application. It's currently a collection of static classes with static methods that return data, like such: // in data access project public ...
2
votes
4answers
338 views

what is the difference between overengineering, underengineering and rightengineering? [closed]

What is the difference between over-engineering, under-engineering and right-engineering at coding/design perspective? I found over-engineering: Coding too much like doing future requirement code ...
3
votes
2answers
176 views

Storing session key in a hidden field

Background: I have a question which is outline at Use different local storage between windows. The very high level question is "How can I keep tabs and windows sessions from clashing". Requirement: ...
1
vote
1answer
111 views

How to avoid tying these two methods together with global mutable state?

I'm in the process of reading Code Complete 2 and learned that using global state is a no-no. What can I do to avoid using global state in this situation? Some background information: I have two ...
1
vote
1answer
112 views

Design Pattern - Adding features to a class

I'm finding myself unable to solve a design problem. For the sake of my simplicity, I'm going to use C# (Web API). Let's say I have an abstract class RestController: public abstract class ...
1
vote
2answers
126 views

Should constructors for API classes ever be public, or can a factory always be used? [closed]

I'm surprised this doesn't seem to have been asked before, or at least I can't find it anywhere. I know this is more of a philosophical question, but is there any particular reason not to use a ...
0
votes
0answers
64 views

Pattern to share fields in inheritance

I'm trying to figure out the best way to solve a design issue. I have to be able to clone (I'm cloning them to Apache HttpClient) different types of HttpServletRequest (POST, GET...) and then send ...
1
vote
2answers
101 views

Alternatives to using dictionary in parameters in C#?

I have a method that takes in a dictionary and enum value and produces a string output. Enum value defines what template string to insert the dictionary key value pairs into. public string ...
0
votes
0answers
25 views

DDD Request Validation Handling

I stuck somewhere that I can't find a solution! There are plenty of validation questions here, but as far as I see, most of them were asking about entity validation. But what about request validation? ...
1
vote
1answer
33 views

Filtering additions to a list

Hopefully Iʼm posting this in the right SX, and Iʼve tagged it correctly. I have a legacy system that Iʼm making additions to which contains a custom list object. This list object can contain two ...
3
votes
2answers
286 views

How to avoid calling String.Replace() in a loop?

I am building a very simple email templating system in C#, and it works amazingly, but I have a personal issue with the way I designed it: Template looks like this: Hello {UserName}, Welcome to ...
0
votes
2answers
36 views

Flag arguments in an html factory class

I have been told that flag arguments(boolean arguments) are a bad thing because it complicates the signature of the method and means that the method does more than one thing. An issue I have with ...
0
votes
1answer
90 views

Designing advanced n-body physics that lead to a stable state [closed]

I'm currently organizing a map with a physics engine that implements a realtime n-body simulation with (somewhat) elastic links. The forces also decrease over time. I've extended it to also work with ...
1
vote
2answers
58 views

One method to search and create if not found, or two methods

Lets say i am writing a web app that accesses user accounts in a database. If the account exist use that data. But if the account doesn't exist create a new one. Should this be done with two or one ...
3
votes
3answers
168 views

Communication between state machine and GUI

I am writing a finite state machine in C++, designed as a library. Furthermore, I have a GUI implemented as a separate project which needs to update the user interface according to state changes ...
4
votes
1answer
153 views

Does REST is only limited to optimistic concurrency control?

Context Due to the statelessness of the REST architectural style involving that each requests stands completely alone, leading server to never store any informations about client. Thus, pessimistic ...
1
vote
3answers
104 views

Unit testing functions calling other tested functions [duplicate]

I have three functions: ValidateUsername(), which determines if a string is a valid username according to some rules SetUsername() which sets a string as a user's Username if it passes validation ...
0
votes
1answer
77 views

Testable design in Swift

I've been searching for so long about how to design testable classes in Swift but every information site just describe basic stuff like how to test, how to assert, why is testing good... My current ...
0
votes
0answers
60 views

php - design: database operations

I am working on a control-panel for a VoIP program and I've been working on it for a while. It started off as a small project that I just did because it was fun, but over time I added more and more ...
-2
votes
1answer
26 views

How to design task assignment system?

I want to design a system which is similar with stackoverflow review feature. That is to say: There are n tasks, which should assign to users (users count is unknown). At one time, one task should ...
0
votes
1answer
50 views

Efficient way to handle foreign keys

I am building a script that checks a large network of sites for invalid links. The idea is to flag links that continuously show as not available so that they can be cleaned by the administration team. ...
0
votes
4answers
251 views

How can I avoid the use of strings?

I'm implementing a program where the user can 'create a musical scale' from a variety of notes (identified by their names), and the program will generate music from this scale. I want to implement a ...
3
votes
1answer
152 views

Providing views to an std::container

I want to maintain a buffer of 5 seconds of sensor data. The sensor data consists, among other things, of accelerometer readings in x,y,z dimensions, gyroscope readings in x,y,z dimension and ...
2
votes
1answer
58 views

Access modifier of abstract class constructors

What access modifier should I use for my constructors in an abstract class, given that the class cannot be instantiated? It seems like the access modifier is superfluous and should be implicitly ...
10
votes
1answer
299 views

Is it good practice to implement two Java 8 default methods in terms of each other?

I'm designing an interface with two related methods, similar to this: public interface ThingComputer { default Thing computeFirstThing() { return computeAllThings().get(0); } ...
1
vote
2answers
42 views

Instantiating a set of Objects from information in File

Let’s say I have four classes A,B,C,D. Each of those classes contains a Tree object. This tree object needs to be built according to information stored in files f_A, f_B, f_C, f_D, for classes ...
2
votes
1answer
71 views

An approach to multilingual db design

My boss is planning on a new db and wants to support multilingual data in this manner: LocalizedDescs (Guid / LanguageGuid being the primary key) Cluster Guid LanguageGuid Desc ProductCategories ...
0
votes
0answers
78 views

Should different projects that share a DB also share data access and other code?

I work on a product that consists of a a single database, and a couple of separate (but related) website projects. The main ones are: public facing site back-office site for our customers to use to ...
0
votes
2answers
194 views

Cost estimation in software engineering

I was asked by my Boss to do a cost estimation for a specific iOS project. Well I have several years of development experience , but I never had to do a cost estimation. What I did so far: iOS I ...
4
votes
1answer
65 views

Where to create a file in WPF/MVVM

I'm building a WPF/MVVM application that takes input from the user and generates an output document which it saves in a temporary folder and opens for display in the native application (e.g. MS Word). ...
0
votes
0answers
20 views

Which document model to choose in different situations

I needed some custom document format and stumbled on this issue. DocBook does it this way <chapter> <title>Chapter 1</title> <para>Hello world!</para> ...
0
votes
0answers
31 views

Where to generate View?

I plan to build a CRM for small companies. It is supposed to be a single-page application. Now I am unsure where it is more efficient to convert the data to HTML. Should I rather do it on the server ...
0
votes
0answers
40 views

Good architecture with DI where low-level components can interact with another hierarchy details

What would be a good design for accessing low-level components attached to another parent? Assume each User has its own hierarchy and one low-level class wants to send a message to some low-level part ...
2
votes
0answers
79 views

Architecture design for Java servlet that triggers work (for sending push notifications)

I'm designing a push notification server (for pushing notification via APNS and Google servers) and have come up with the following design for a Java based web application server. I would really like ...
6
votes
6answers
686 views

What are the most used pattern to manage a lot of interconnected parameters?

I recently start to work on an application that drive different measurement device. Before the user start a measure, she sets the parameters of it. Actually, considering all measurements type there ...
0
votes
0answers
41 views

Best practices for creating a project utilities module? [migrated]

Does anyone know of any best practices around creating a utilities module or class specific to your project? I have a project I've been working on that has three different moving pieces, but we keep ...
-3
votes
0answers
41 views

For Review: My UML Structure for a PHP PDF Invoice Module

I like to develope a simple PDF Invoice Module on PHP5. It s important for me to provide a good design and code structure. For that, I made the following UML: http://postimg.org/image/yzxandd0p/ The ...
0
votes
0answers
39 views

Implementing peristent events using WCF-MSMQ

I am implementing a WCF-MSMQ based message queue that will follow the pub-sub model in which multiple publishers would publish an event and multiple subscriber would listen to it i.e a many to many ...
0
votes
0answers
31 views

Defensive Programming - “Return” placement [duplicate]

Sometimes I see myself writing code in the following way: if(value == null) return null; //... I will have here as many defensive conditions (and returns) as I need //... Continue to execute method ...
1
vote
2answers
161 views

Is there a pattern to assist with working around or fixing violations of the Liskov Substitution Principle? [closed]

I've come across a rather large violation of the Liskov Substitution Principle in our codebase. There is an abstract class. Within it is an abstract method, implementers of which are expected to ...