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

learn more… | top users | synonyms (1)

1
vote
1answer
40 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
66 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
0answers
18 views

What are the important features of a Portal Framework? [on hold]

I am looking to build a portal framework similar to liferay/ backbase. I want to discuss the important things that I need to take care of. e.g. Security/ UI / Extendability/ Customization etc.
0
votes
1answer
89 views

Is service layer obligatory? [on hold]

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 ...
78
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
239 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
53 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
67 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
91 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
530 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
55 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
319 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
92 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
106 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
0answers
50 views

why this design for a reservation engine? [closed]

We have a reservation system. It has a particular feature to manage users using the system: it disallows the user to login from multiple channels. At any time, the system ensures that a user is ...
2
votes
2answers
200 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 ...
-3
votes
0answers
64 views

Developing android app that can communicate each other [closed]

My Objective I want to create two android applications that can communicate each other. Let's call them Application A and Application B for now. Application A will have some buttons which will send ...
0
votes
0answers
13 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
107 views

What is an Application Core? [closed]

I have read Patterns For Large-Scale JavaScript Application Architecture by Addy Osmani, and I was suddenly hit by a question about an application core. What is an application core? What makes it? ...
1
vote
1answer
32 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
118 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
33 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
47 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
105 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
135 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
47 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
26 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
81 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
99 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
50 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
211 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
74 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
258 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
174 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
84 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
369 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
98 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
106 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 : ...
81
votes
12answers
10k views

Is testable code better code?

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
99 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
208 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
356 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
183 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
116 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 ...