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

learn more… | top users | synonyms (1)

1
vote
7answers
620 views

Significant amount of the time, I can't think of a reason to have an object instead of a static class. Do objects have more benefits than I think? [closed]

I understand the concept of an object, and as a Java programmer I feel the OO paradigm comes rather naturally to me in practice. However recently I found myself thinking: Wait a second, what are ...
18
votes
3answers
11k views

Which is a better practice - helper methods as instance or static?

This question is subjective but I was just curious how most programmers approach this. The sample below is in pseudo-C# but this should apply to Java, C++, and other OOP languages as well. Anyway, ...
2
votes
2answers
163 views

Static / Shared Helper Functions vs Built-In Methods

This is a simple question but a design consideration that I often run across in my day to day development work. Lets say that you have a class that represents some kinds of collection. Public ...
2
votes
4answers
207 views

Callbacks: when to return value, and when to modify parameter?

When writing a callback, when is best to have the callback return a value, and when is it best to have the callback modify a parameter? Is there a difference? For example, if we wanted to grab a list ...
1
vote
1answer
71 views

Architecture driven by users, or by actions/content?

I have a question about designing MVC app architecture. Let's say our application has three main categories of views (items of type 1, items of type 2...). And we have three (or more in future) ...
15
votes
8answers
2k views

Why does Clang/LLVM warn me about using default in a switch statement where all enumerated cases are covered?

Consider the following enum and switch statement: typedef enum { MaskValueUno, MaskValueDos } testingMask; void myFunction(testingMask theMask) { switch theMask { case ...
3
votes
1answer
102 views

Synthetic database records

Assume we are getting some statistics from a customer which we analyse and we send our comments to the customer. Now, the customer tells us that the statistic they computed between January and March ...
2
votes
1answer
125 views

How to Detect Sprites in a SpriteSheet?

I'm currently writing a Sprite Sheet Unpacker such as Alferds Spritesheet Unpacker. Now, before this is sent to gamedev, this isn't necessarily about games. I would like to know how to detect a sprite ...
1
vote
1answer
43 views

Handling Types for Real and Complex Matrices in a BLAS Wrapper

I come from a C background and I'm now learning OOP with C++. As an exercise (so please don't just say "this already exists"), I want to implement a wrapper for BLAS that will let the user write ...
0
votes
3answers
220 views

Is there a common programming term for the problems of adding features to an already-featureful program?

I'm looking for a commonly used programming term to describe a software-engineering phenomenon, which (for lack of a better way to describe it) I'll illustrate first with a couple of ...
0
votes
2answers
213 views

How to design console application with good seperation of UI from Logic

Is it considered an overkill for console application to be design like MVC , MVP or N tier architecture? If not which is more common and if you can link me to simple example of it. I want to ...
0
votes
2answers
56 views

Is it good practice to keep 2 related tables (using auto_increment PK) to have the same Max of auto_increment ID when table1 got modified?

This question is about good design practice in programming. Let see this example, we have 2 interrelated tables: Table1 textID - text 1 - love.. 2 - men... ... Table2 rID - textID 1 - ...
1
vote
4answers
253 views

“Collection Wrapper” pattern - is this common?

A different question of mine had to do with encapsulating member data structures inside classes. In order to understand this question better please read that question and look at the approach ...
1
vote
2answers
121 views

Flags with deferred use

Let's say I have a system. In this system I have a number of operations I can do, but all of these operations have to happen as a batch at a certain time, while calls to activate and deactivate these ...
0
votes
1answer
60 views

How are the conceptual pairs Abstract/Concrete, Generic/Specific, and Complex/Simple related to one another in software architecture?

(= 2 (+ 1 1)) take the above. The requirement of the '=' predicate is that its arguments be comparable. Any two structures are comparable in this case, and so the contract/requirement is pretty ...
4
votes
3answers
327 views

Inheritance vs containment while extending a large legacy project

I have got a legacy Java project with a lot of code. The code uses MVC pattern and is well structured and well written. It also has a lot of unit tests and it is still actively maintained (bug fixing, ...
0
votes
0answers
102 views

Architecture or Pattern for handling properties with custom setter/getter?

Current Situation: I'm doing a simple MVC site for keeping journals as a personal project. My concern is I'm trying to keep the interaction between the pages and the classes simplistic. Where I run ...
0
votes
1answer
95 views

Should interface only be used for behavior and not to show logical data grouped together? [duplicate]

Should an interface only be used to specify certain behavior? Would it be wrong to use interface to group logically related data? To me it looks like we should not use interface to group logically ...
5
votes
5answers
574 views

Should I always encapsulate an internal data structure entirely?

Please consider this class: class ClassA{ private Thing[] things; // stores data // stuff omitted public Thing[] getThings(){ return things; } } This class exposes the ...
0
votes
1answer
105 views

Are sequence designs appropriate for GUI button design?

Specifically, I have numerous buttons that will be changing color based on state information from operator input and input from various subcomponents and sensors. I would like to use UML or some ...
0
votes
1answer
103 views

Clean way to use mutable implementation of Immutable interfaces for encapsulation

My code is working on some compost relationship which creates a tree structure, class A has many children of type B, which has many children of type C etc. The lowest level class, call it bar, also ...
9
votes
2answers
217 views

Using packages (gems, eggs, etc.) to create decoupled architectures

The main issue Seeing the good support most modern programming platforms have for package management (think gem, npm, pip, etc), does it make sense to design an application or system be composed of ...
2
votes
1answer
185 views

Best practice to collect information from child objects

I'm regularly facing following pattern: public abstract class BaseItem { BaseItem[] children; // ... public void DoSomethingWithStuff() { StuffCollection collection = new ...
2
votes
6answers
496 views

What is the best design decision approach?

I have two classes (named MyFoo1 and MyFoo2) that share some common functionality. So far, it does not seem like I need any polymorphic inheritance but, at this point, I am considering the following ...
76
votes
11answers
5k views

Why should main() be short?

I've been programming for over 9 years, and according to the advice of my first programming teacher, I always keep my main() function extremely short. At first I had no idea why. I just obeyed ...
2
votes
0answers
115 views

How does a search functionality fit in DDD with CQRS?

In Vaughn Vernon's book Implementing domain driven design and the accompanying sample application I found that he implemented a CQRS approach to the iddd_collaboration bounded context. He presents ...
1
vote
2answers
157 views

Scenario to illustrate how unit testing leads to better design [closed]

For an internal training session, I'm trying to come up with a simple scenario that illustrates how unit testing leads to better design, by forcing you to think about things like coupling before you ...
2
votes
1answer
156 views

How to fix poorly designed software? [closed]

I am working on large project solo as a hobby, and I made a mistake in the very beginning: I jumped right into programming without giving a second though to design. Now I am nearly 6 months in and ...
2
votes
4answers
209 views

At what point does data access\manipulation logic becomes business logic?

Consider a service which updates PersonDetail tables in database. I am Using EF which maps the table to this Entity. When a record is updated, it is not actually updated but a new record is created ...
1
vote
0answers
46 views

Is using partial classes for supporting multiple versions of data entities for continuous delivery scenarios a bad idea?

When you want to have continuous delivery any data schemas that you have must support multiple versions of your application at the same time (as you may have multiple version deployed when new ...
3
votes
1answer
156 views

Does this Decorator implementation violate the Liskov Substitution Principle?

Please consider the following implementation of the Decorator design pattern: WordBank objects store strings and return them to the client through the method getWords(). The decorator class, ...
1
vote
3answers
104 views

Best way to find whether a collection does or does not contain an element with a specific desired quality

It seems to be a very common thing to have to tell whether some list or set contains at least one object matching a given condition, yet my prior searching and reading have never found a satisfactory ...
0
votes
0answers
35 views

automated acceptance testing / BDD & workflow for designing a system

Recently, I started reading the book Specification by Example, which relates to automated functional testing and BDD (from what I've understood till now). I've tried using Concordion (.Net), and ...
20
votes
4answers
2k views

Architectural differences between dynamic and static languages

Are there any major architectural differences when designing applications that will be built on static languages (such as C# or Java) and dynamic languages (such as Ruby or Python)? Which are the ...
12
votes
8answers
2k views

Conception and design before coding: how much is this true? [closed]

I learned at school as well as I read everywhere else that a good development methodology needs conception and design before coding properly. That is not a new information even for a beginner ...
5
votes
0answers
77 views

How significant is the impact of the type system (static/dynamic) on the overall design of programs? [duplicate]

Coming from Java, I've never used a language with dynamic typing. I'm very used to the static-typing way of thinking. My question is, how much does the use of dynamic typing as opposed to static ...
6
votes
3answers
274 views

How to adhere to the open-closed principle in practice

I understand the intent of the open-closed principle. It's meant to reduce the risk of breaking something that already works while modifying it, by telling you to try to extend without modifying. ...
8
votes
10answers
713 views

What should be first - functionality or design? [duplicate]

I've started reading a book from Head First series about OOP and Design. In a first chapter it is stated I have to worry about design of my application just after basic functionality is ready. Basic ...
4
votes
2answers
393 views

How to delete an object when other things reference it (and not making the code full of inter-dependencies)

The situation: In my program, there are a list of cues. To call a cue at a certain time, there are objects called Triggers. Cues have many public methods that allow them, among other things, to be ...
4
votes
1answer
265 views

Loose Coupling Presenter to View in MVP

We work in a Java shop here and our web application uses an implementation of the MVP architectural pattern. Our manager comes from a .NET world, where he has been exposed to the MVVM design pattern. ...
0
votes
0answers
26 views

method of validating sanity of order dependent values received asynchronously

I have a series of hardware devices that I'm connecting to create paths through. I have some sanity checking to make sure if potential paths are valid and will do what is intended, but to do it ...
8
votes
3answers
334 views

Designing unit tests for a stateful system

Background Test Driven Development was popularized after I already finished school and in the industry. I am trying to learn it, but some major things still escape me. TDD proponents say lots of ...
22
votes
9answers
2k views

Are there any programming languages that follow a minimalist development approach?

I find it that when languages are considered the same as commercial software, there is always a constant need to add new features to justify new releases. Can there be or are there languages where ...
5
votes
2answers
942 views

Should I feel “uncomfortable” using auto in C++? [duplicate]

C++11 features the new auto type declaration, allowing you to work with an object without ever knowing its actual type. I use only strongly typed languages - C++, Delphi (Object Pascal), Go, etc and ...
5
votes
1answer
143 views

Strategies to manage multiple clients able to simultaneously edit same data

How can I deal with situations when multiple clients might edit same object at the same time? For example, I have a web app with admin console, which lets you edit profile data. Several users want to ...
2
votes
1answer
202 views

How to design the relation between a Game and a Player in a game?

I am currently attempting to make a Trading Card Game and I have got a whole array of features working already, yet I am stuck now at the portion where one player can attacker another player (more ...
2
votes
1answer
128 views

Website as an API client vs using the API only when needed?

I'm developing a website (using Django) which will depend on an API for it's main functionality which is create/update/delete objects. But the API also provides: User sign up and login User ...
2
votes
1answer
67 views

How to handle errors best addressed in a higher abstraction layer and dependent on state inferred in current layer?

I have a use-case that can be repaired, but the logic for repairing it is best done in a higher level of abstraction. Just throwing exception/failure is ugly because it's hard to pass back up through ...
0
votes
1answer
85 views

How to employ amatuer knowledge of software architecture and design in an agile manner? [closed]

I have a problem when designing any application that is either greenfield or a refactored brownfield due to often finding a potential flaw or an uncertainty with the design or architecture that I ...
0
votes
1answer
170 views

pattern to share objects between API and application

I'm having serious doubts about the design for my Web application. I wanted to separate the business logic from the interface so I made a Web API that handles all the requests to the database. It's ...