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

learn more… | top users | synonyms (1)

0
votes
1answer
99 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
600 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
107 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
108 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
220 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
190 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
497 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
120 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
159 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
158 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
212 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
161 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
105 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
39 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
289 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
728 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
402 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 ...
3
votes
1answer
285 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
27 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
341 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
950 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
148 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
204 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
131 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
69 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
89 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
202 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 ...
2
votes
1answer
141 views

Adapter Pattern: Design Patterns

So far as I know, there are two forms of the Adapter Pattern: the class adapter and the object adapter. Could someone please explain to me the following limitation of the class adapter and why it is ...
0
votes
0answers
31 views

Organizing an image processing pipeline for on-the-fly video analysis

I'm trying to design a system that performs image analysis on video streams from the internet. I have a few rudimentary ideas for how to organize such a system, and I was hoping you guys could ...
1
vote
1answer
91 views

Collaboration between a Graphic Designer and Expression Blend developer? [closed]

I'm new to the programming world and also a little bit confused. My brother would like to work with me on some program. I'm a graphic designer so he asked me for UI and all it's elements. I would ...
4
votes
1answer
93 views

Merging around 15 small Git repos of non-optional centralized web service components to a single large repo

In a centralized web service we break down the components into various small Git repos by software modules, e.g. authentication module, authorization module, data access module etc. (around 15 repos ...
0
votes
1answer
34 views

Logging system interactions as a user vs as a flag

When running a site that has a CRM with a logging facility that logs users interactions (someone changing a name, address or user permission etc), is it better to log system interactions (automated ...
3
votes
1answer
79 views

Access items of a container with a pattern

I've two C++ classes with a relation: a container class which has a list of items. For example a library has got many books. The classes are the library and the book. Now from the external world I ...
1
vote
2answers
134 views

Should methods returning a hashmap of string to object be avoided?

In my current code I have felt the desire multuple times to have helper methods that generate a collection of objects and return them as a map of string to object, with the string being some unique id ...
13
votes
5answers
2k views

What is the good explanation of Tennent's Correspondence Principle?

I found myself struggling to see what is this principle about and why is it so important for language design. Basically, it states, that for every expression expr in language should be exactly the ...
1
vote
4answers
519 views

Can recursion be done in parallel? Would that make sense?

Say, I am using a simple recursive algo for fibonacci , which would be executed as: fib(5) -> fib(4)+fib(3) | | fib(3)+fib(2)| fib(2)+fib(1) and so on ...
10
votes
6answers
625 views

Where, in an object oriented system should you, if at all, choose (C-style) structs over classes?

C and most likely many other languages provide a struct keyword for creating structures (or something in a similar fashion). These are (at least in C), from a simplified point of view like classes, ...
1
vote
1answer
78 views

Using a list of tuples vs a list of custom objects

I have a situation where I have several text documents and I want to create a list that contains the words in those documents. But I also need to record several properties of each word. These ...
2
votes
0answers
45 views

How deep is enough to represent an algorithm in UML sequence diagram?

I have three simple classes. LoginController, UsersCatalog and User. UsersCatalog has an array of User. I have to represent a simple process of login. LoginController has a method login(username, ...
2
votes
2answers
210 views

What do I gain by using the Strategy pattern in this case?

I wrote a program with Java that plays simple music. Currently chords have only one way ('strumming pattern') to be played. I want to expand this and create different 'strumming patterns' that chords ...
5
votes
2answers
351 views

Design of high performance file processing web application

I'm trying to design a web app with ability to scale but can't wrap my heads around few concepts. I want to design it right but im not a experienced programmer, i have more of a system engineering ...
0
votes
1answer
83 views

MVC: Where should I store interchangeable algorithms used by the Model (whose names also need to be accessible to the View)?

Please consider a program, where the user chooses an algorithm from a list, and the Strategy pattern is utilized to set this algorithm as the model's operation. For example, an image procession ...
6
votes
2answers
444 views

MVC: my controller seems useless half of the time. Is this a problem?

Often when I design a program with MVC, the controller is useless half of the time. What I mean is this: something happens on the view (e.g. a button click). The view then notifies the controller. ...
0
votes
1answer
96 views

Unit-based architecture

This is probably a damn fool question, for which I apologise, but I can't seem to get the google syntax right to find an answer. Imagine a Property, like this: private int _type public int Type { ...