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

learn more… | top users | synonyms (1)

-1
votes
2answers
23 views

Is it ever overkill creating classes/objects?

I just learned how to create a class or object in C++ and I'm practicing and learning. I'm writing a text based version of a popular board game and I was wondering if it's overkill creating a class ...
0
votes
0answers
19 views

Writing a Python class that provides default instance succinctly [migrated]

I have a Python class for which I'm often going to want an instance with the default arguments, but I want the class to allow creation of instances. For brevity I'd prefer that the default instance be ...
6
votes
3answers
261 views

Should I, and if so how do I, learn to favour upfront design with abstraction over retrospective removal of repetition? [duplicate]

I am often in a situation where I have to design and code a process/algorithm, and there are different variants on that algorithm. For example, I am currently writing some database sychronisation ...
1
vote
1answer
59 views

Should I put stack trace in error files and halt my app with user friendly error [on hold]

In my earlier project I wrote an app that is used in-house. My usual practice is to capture errors/exceptions from different classes and threads and put them in different log files corresponding to ...
0
votes
0answers
39 views

Writing a container that treats nearly-identical images as the same

I want to create a mapping in Python that will use images as keys, but treat similar (but not identical) images as the same key. I have an approach for deciding which images are similar enough: I ...
26
votes
6answers
4k views

Is it better to store data in a small, unreadable format, or a large, readable format? [on hold]

I'm often conflicted when creating a project that requires manipulation of data in files. Often times, I store data in a readable format, like JSON, as seen below: { "Project 1": { ...
2
votes
3answers
155 views

Train domain specialists in programming, or train developers in the domain? [on hold]

As software developers, we are often told that our job is not to write code, but rather, it is solving problems in a given domain, with code as our tool of choice. This strikes me as the cause of a ...
1
vote
0answers
44 views

If the externally callable interface of a class is called its API, what is “what can be overridden” called?

It's about what the class gives access to through inheritance. It has a three letter abbreviation but not API. I've seen this before but can't remember at the moment. The term is usually used in ...
1
vote
1answer
33 views

Database + Java Design for a scenario

Overview A central web application to supports other web applications(A) for user and its role/permission management. Applications (A) call the central application via API to get the user ...
0
votes
3answers
53 views

Sacrifice server validation in pos of performance with Rich Client validation?

I recently started to work in a java enterprise project (~200 people) that uses a SWT rich client. In many cases I've found business rules not being validated in server side, because the widgets that ...
0
votes
1answer
18 views

Availability on updating, migration, etc

When you want to update, migrate or deploy-new-version of a large and/or critical system, absolutely, you can't shutdown the system and do your job, then start it!!! I want to know what's the ...
1
vote
1answer
44 views

How “close” should a IO class/logic be to a form or thread that controls the IO device?

I am having a difficult time determining where my IO logic should reside within my application. In this application there are multiple IO devices both USB and serial. I currently have the idea to ...
1
vote
1answer
72 views

How to handle design changes for auto_ptr deprecation in C++11?

We are testing a library under C++11 (i.e., -std=c++11). The library uses auto_ptr and this pattern: Foo* GetFoo() { autoptr<Foo> ptr(new Foo); // Initialize Foo ...
0
votes
1answer
91 views

Is service layer obligatory? [closed]

I am going to implement not big web application and it seems that there are not (or almost not) any business logic in it. Only CRUD operations + some filters + security. So the question is -Is it ok ...
83
votes
14answers
11k views

How to stop thinking in terms of code? [on hold]

I am a C++ developer at a fairly large organization which has a huge codebase. During the last 6 months since I joined, my mentor has always told me this every time we met for design reviews or ...
4
votes
3answers
249 views

How can I add properties to subclasses and access them without casting from a superclass?

I'm trying to model a multi-dimensional point class in C#. I have about eight different types of points, and there may be more in the future. Right now, I have a superclass (PointBase) that holds all ...
1
vote
3answers
58 views

How to reuse domain model logic in services?

I am trying to avoid anemic domain models as it's said to be an anti-pattern. But doing so leaves my services to duplicate some of the logic. class User { public $status; public function ...
2
votes
1answer
70 views

Define an object with the interface as a type instead of class name [duplicate]

I try to practice with the design patterns and explore one of the possible implementations of the Observer Design Pattern in Java. I paid attention, that in this example the object is defined with the ...
2
votes
2answers
96 views

Final steps of wrapping up a Python script into a program

I finished building a Python script containing eight functions which download files, extracts them, manipulate and analyze their data and then produce graphs and export them into PNG files. The ...
8
votes
1answer
531 views

Maintaining separation of concerns

I'm making my first C# app and I am having a bit of difficulty with separation of concerns. I understand the concept, but I don't know if I'm doing it right. I have this as a quick example to ...
0
votes
1answer
56 views

What is the best way to organize RESTful endpoints [closed]

Let's say I have two types of resources I want in my API: person and class. These two have a many-to-many relationship. As such, would I expect to be able to interact with the following endpoints: ...
0
votes
3answers
321 views

i++ vs i+=1 in cycles, why evaluate? [closed]

Why do most programmers use i++ in cycles? Doesn't it mean evaluate and increment. I find more logical to use just an increment i+=1, because that's all I want. WriteLn(i++); would evaluate i and ...
2
votes
2answers
94 views

Depend in the direction of stability: How do I know what is more stable?

According to the Stable Dependencies Principle, the dependency should be in the direction of the stability But: if you don't know what types of changes are likely, it is best to wait and see ...
1
vote
3answers
108 views

Help me design this use case

I have following entities: Data: User_id Categories: Interests, Disinterests, Categories A, B C... Each categories have sub categories: Interests=Gaming, Physics, Programming etc.. Now each user ...
2
votes
2answers
201 views

private method that uses no instance members - better static? [duplicate]

I have a private helper method that uses no instance variables or methods, I feel it would be less confusing if it was static (this way, it's given fewer points it can access). I am a bit unsure if ...
0
votes
0answers
14 views

Integrating legacy application with new functionality

We have a legacy application with, among other things, the ability to create instances classes within VB6 DLLs dynamically and call methods with varying signatures. We have no way of accessing the ...
1
vote
1answer
33 views

How to model table and column objects and their relation

I'm working on a small application where I need to model tables and columns from a relational DB. I've been reading some material on nested classes, which is recommended to be used sparsely. However ...
3
votes
3answers
125 views

Returning a Flag Indicating Success

Whenever I'm writing code, I always stub out my methods like this (not necessarily using generics): public T MyMethod() { T result = default(T); // or null return result; } This always ...
4
votes
4answers
120 views

Instantiating class that contains methods to check some of the settings and also return values from my app.config file

I am writing a console application and have a class called ApplicationConfiguration that contains methods to check some of the settings and also return values from my app.config file. For instance ...
1
vote
1answer
90 views

Database Design: Rules for students and student groups

I am new to databases. I am using MySql. What I have is a student system which stores rules for students in a school. Each student may or may not be a part of a group (Soccer, Guitar, etc). ...
0
votes
0answers
35 views

Design for local text storage (70 000 words) in iOS

I would like to code an interactive story app for iOS devices. There will be a large amount of words locally stored.(70 000, 35 000 for each language as the text will be available in two languages). ...
0
votes
1answer
50 views

Multiple different versions of similar apps in one project

I need some help to improve the architecture of a site I've built. What I want to achieve within a single Django project is the following: I want a site that comes in several versions (one per ...
0
votes
1answer
90 views

Moving methods to a MasterClass so it can be overridden, is there a better way?

I'm looking at a very large object within the application I'm working on, which is there to basically hold all the data together at a large level. Recently, we have started moving some methods out of ...
2
votes
3answers
108 views

Unit testing text output

I have recently become responsible for a legacy tool that analyses code and provides a log as output. As part of the JUnit suite for this, there are ~100 tests that rely on successfully matching the ...
7
votes
1answer
150 views

Do we need to validate entire module usage or just arguments of public methods?

I've heard that it is recommended to validate arguments of public methods: Should one check for null if he does not expect null? Should a method validate its parameters? MSDN - CA1062: Validate ...
0
votes
2answers
48 views

Built-in the separate thread execution inside of the method or wrap the method by the thread

Let assume, I have some resource and time-consuming code, which I want to arrange as a separate method. In order to optimize the performance, this code should be executed in the separate thread. Now ...
0
votes
0answers
27 views

Event-handling in WinForms MVC-Implementation

I am trying to implement sort of an MVC-Pattern (Passive View) for a winforms-application to clean up the code. The basics are quite clear and I did implement some views of the application in ...
2
votes
1answer
82 views

How to implement role permissions in service layer?

In my current project i have Report class and i am going to implement service layer for it. Every method will be allowed only for some roles. Like this. public class ReportService : IReportService { ...
0
votes
1answer
100 views

How to access a variable that I only need to create once on Application.Start

According to this guide: https://github.com/mspnp/azure-guidance/blob/master/Retry-Service-Specific.md They say: Note that the StackExchange.Redis client uses multiplexing through a single ...
2
votes
1answer
51 views

Getting items from a ListView - without breaking MVC paradigm?

I've got an arraylist of SpecialParts. A SpecialPart is an object that holds a bunch of information about itself: name, ID, date created, etc. I've got a ListView that presents the user with all the ...
6
votes
3answers
212 views

Should instance of Employee contain a reference to instance of Office, or should Office contain an array of Employee?

Title is an abstraction of what I am actually doing, but in essence the same. The main entity I will be dealing with are the Employees themselves; "Send package to employee John Doe". In order to ...
1
vote
3answers
75 views

Event logging: record a whole message, or a list of properties and generate?

I've written a simple event logging system, which I write to with a function similar to: void IIncidentLogic.ReportIncident( string code, string noun, string hostname, DateTimeOffset ...
1
vote
3answers
142 views

What is a good Design Pattern for a bundle of methods that comprises an algorithm?

This is a Design question relating to finding out a good OO design pattern or design structure or class combination that can house an algorithm that processes user selection to produce product ...
-3
votes
2answers
137 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
3answers
265 views

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

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 ...
1
vote
1answer
54 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
176 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
85 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 ...
9
votes
3answers
372 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
99 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 ...