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

learn more… | top users | synonyms (1)

1
vote
1answer
49 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
3answers
127 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
1answer
122 views

Is it a good idea to have separate UI components make their own webservice calls?

I have few UI components in an angularjs web-application. Each display data based upon same input. One shows stats which are calculated on the basis of a time period. Other shows a chart of daily ...
8
votes
1answer
238 views

C++ serialization design review

I am writing a C++ application. Most applications read and write data citation needed and this one is no exception. I created a high level design for the data model and serialization logic. This ...
33
votes
11answers
14k views

Is catching general exceptions really a bad thing?

I typically agree with most code analysis warnings, and I try to adhere to them. However, I'm having a harder time with this one: CA1031: Do not catch general exception types I understand the ...
1
vote
0answers
21 views

Abstract Alert Dialog Builders (Same Method Calls, Different Objects)

Currently I'm working on an Android library that creates a dialog which allows to select colors from a palette (examples at the end) and I've stumbled upon an interesting design problem. To create ...
2
votes
3answers
90 views

Responsibility of the small business logic: in a class or in a method?

I have separated business logic to many small blocks. Each block can be coded in small number of lines. Where should I put the block code? [A] in a method, grouped in the class by some same feature ...
3
votes
6answers
788 views

Is scanning the ports considered harmful? [closed]

If any application is scanning the ports of other machines, to find out whether any particular service/application is running, will it be considered harmful? Is this treated as hacking? How else can ...
3
votes
1answer
67 views

Designing a ticketing system where the User and Administrator have similar but different functionality

I am designing a simple ticketing system in Laravel 4. The system will simply allow a User to create a ticket, and an Administrator to answer it. The User will be able to: View a list of his ...
1
vote
3answers
123 views

How can I create an abstract parent class which uses data from an inherited class?

I'm getting my feet wet with Android app development and tying to find a good way to manage database interactions across multiple similar objects. My goal was to have a structure like: public ...
2
votes
1answer
95 views

Integration between services in a SOA

Assume we have a Bounded Context for Inventory (InventoryBC) and another one for Shipments (ShipmentsBC). These 2 BCs need to communicate together. They are hosted on 2 different services on different ...
4
votes
1answer
593 views

Capturing mobile device system (output) audio

I'm trying to figure out a way to capture the system audio of an Android and/or Windows Phone. The idea is to provide a stream based on the music I'm currently playing on my phone. What I'm not sure ...
2
votes
3answers
655 views

can you have too many dto/bo - mapping method

I have a windows service, 2 web services and a web interface that need to follow the same path (data wise). So I came up with two ways of creating my solution. My concern is the fact that the ...
4
votes
4answers
431 views

When should code favour optimization over readability and ease-of-use?

I am in the process of designing a small library, where one of my design goals is that the API should be as close to the domain language as possible. While working on the design, I've noticed that ...
0
votes
2answers
149 views

Ensuring program output is always the same [on hold]

I am working on a +10k LOC program, and I need to ensure its output is always the same for given input. The program consists of dozens of modules and classes, inherited by a MainClass. Initially I ...
3
votes
3answers
344 views

Object creation: when should I expose a factory vs wrapping class?

I am having some problems trying to figure out when to use a factory or to wrapper class. This question is slightly geared towards C# I guess, so I'm not sure if this is the correct place to ask. Say ...
0
votes
1answer
63 views

Best Practices: URL Path Parameters [on hold]

What's the current best practice around path parameters in URLs? For instance /artist/name A long time ago I might have made artist.html and then passed in a query parameter /artist.html?name=name ...
1
vote
1answer
641 views

MVC URL structure with URI parameters

When creating routes for your MVC web application I have seen two possible ways to pass variables to a controller method: With the first approach the variable is passed to a parameter of the ...
1
vote
4answers
178 views

Strategy pattern and “Is a” relationship

Imagine, I have class IAlgo which is an interface. I have derived from him and implemented his single method called matchCount in different implementations - AlgoA1, AlgoA2, AlgoA3, AlgoB1, AlgoB2. ...
0
votes
1answer
78 views

How to design resilient web service clients?

I am writing an app that is supposed to talk to a web service. Let's say it's a chat app. It would need to receive a stream of new messages (so that they are pushed to the interface as quickly as ...
4
votes
3answers
246 views

Fine grained search over a large dataset

I have roughly 4 million records per day and have to keep 7 years worth online, so we are looking at 10.2 billion records that I need to be able to search through. The users are expecting that the ...
4
votes
0answers
52 views

Seeking opinions on using device tree for I/O definition

I've been working ELLCC, a clang/LLVM based development tool chain targeting ARM, Mips, Microblaze, PowerPC, and x86 targets. The tool chain is pretty complete and runs on Linux, Windows, and Mac OS ...
0
votes
1answer
74 views

Collections.sort question

My question maybe related to this question - Encapsulating Internal Data Structure I have a class LCTile.java which contains a Coordinate.java class. Coordinate.java that contains latitude and ...
20
votes
7answers
4k views

Is there a more intelligent way to do this besides a long chain of if statements or switch?

I'm implementing an IRC bot that receives a message and I'm checking that message to determine which functions to call. Is there a more clever way of doing this? It seems like it'd quickly get out of ...
6
votes
6answers
652 views

Finding most Important Node(s) in a Directed Graph

I have a large (≈ 20 million nodes) directed Graph with in-edges & out-edges. I want to figure out which parts of of the graph deserve the most attention. Often most of the graph is boring, or at ...
1
vote
3answers
192 views

Is it ok if a method returns a new instance of the class it's in?

I have a class called MyClass and a method called Get that looks something like this: public class MyClass{ string ClassVariable1 {get; set;} string ClassVariable2 {get; set;} string ...
1
vote
1answer
65 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 ...
1
vote
2answers
97 views

Is it considered good practice to use mutables this way? [closed]

Lately I came across a way of using mutables which I had not thought of before. Let's say you have a list comprehension which calls a method, and you put the result in a list like the following ...
1
vote
4answers
205 views

OOP Principles in Customer and Account classes of a Bank

I am designing a Bank Application which deals with Customers having FD Accounts. There are two approaches to this : Approach 1 In this the customer has a list of accounts. The bank application ...
1
vote
3answers
124 views

How to understand if a property is a member of a class or I have to create a different class that holds it?

Sometimes when you create a class you can add there several properties (new data members) that you are not certain if you want to do or not. For example, I have a casino slots game. I have tiles and ...
6
votes
3answers
447 views

Is using hashes for primary keys a good idea?

The Austrian electronic ID card relies on the so-called sector identifiers. For example a hospital gets to identify a person by getting a sectorId for that person, which is computed roughly as ...
1
vote
1answer
70 views

“Is a” relationship or, in other words Inheritance

Say I define an interface IAnimal which has a pure virtual (abstract) method called eat like this: class IAnimal { virtual void eat(Food*) = 0; }; In the future I inherit form IAnimal and create ...
1
vote
2answers
49 views

Operations Job Queue Strategy

I am working on an application that requires manual approval of requests put in by customers. Now lets say there are 10 people involved in this operation and each of them has a webpage in front of ...
3
votes
3answers
103 views

How to handle time based events in web application backend?

I'm currently working on design of small web service, and I have a following feature (simplified): After some user actions, there is a wait period (ranging from 30sec to 40h) and after it's passed, ...
0
votes
0answers
48 views

Dll that uses services from its caller [closed]

I am making simulators with graphic engine based on c++. I decided to make a dll for shells/bullet shooting for the use of the simulators. The thing is that the dll need information of the terrain ...
1
vote
1answer
69 views

Design periodic batch notification system

Problem: I am trying to design a system which takes requests from customers in real time and log them in a database. For example - request to purchase an item. The customer then gets a unique ...
2
votes
2answers
417 views

Why doing everything with one software project is wrong? [closed]

I am newly employed by a company. After a couple of weeks, I have heard lots of time that there is a huge project which most of the programmers are working on it. They call it something like Managing ...
2
votes
1answer
95 views

How to best model an application's settings?

My application has a configuration file and a "Settings" window. When the user confirms the changes in this window they are applied and written to the config file. These settings are often changed ...
7
votes
2answers
535 views

Dependency Inversion Principle: Understanding how both low level components and high level components depend on abstractions

I'm learning about the Dependency Inversion Principle. It states that: High level modules should not depend upon low-level modules. Both should depend upon abstractions. For a while I tried to ...
1
vote
1answer
80 views

Is Python's calendar.month_name implementation of an empty string in the first index good practice or poor design?

The documentation states: An array that represents the months of the year in the current locale. This follows normal convention of January being month number 1, so it has a length of 13 and ...
3
votes
2answers
157 views

How does Functional Programming's immutability feature work with CQS?

Given immutability (which is often encouraged and said to be one of building blocks of functional programming) and CQS (which says that commands should not return a value other than void/unit), how do ...
39
votes
6answers
1k views

What's the right way to work with a graphic designer? [closed]

Recently, we worked with a graphic designer (arranged by the client) to provide the skin for a Django+Bootstrap application we had built. The designer provided a series of static images of the new ...
2
votes
1answer
129 views

Usage - Factory Pattern vs Dependency Injection [closed]

Okay, this question is not on which is better. It is more about when to use Dependency Injection vs Factory. I have done a bit of research and it goes like this. DIP: Provides loose coupling, ...
3
votes
1answer
77 views

Implementing a requirement with a decorator and ensuring it's usage

In a shared library I have a function that is widely used. I'm implementing a requirement for the function to override it's behavior when the entities are in a specific state. I have decided on ...
2
votes
1answer
52 views

Synchronization of resource that has moved out of requests filter range

I have a RESTful API with corresponding clients. If a client request fetches a set of resources (Events) based on a filter, say events taking place between 2015-04-13 - 2015-04-19. If an event which ...
2
votes
2answers
119 views

When should services persist data? [closed]

Is there a preferable way of when a service should persist data? Update Does this depend on if the services are public or internal? Some services take entity objects as parameters to do some action ...
2
votes
2answers
346 views

Program like NASA?: Margaret Hamilton's Three Primitive Control Structures [closed]

On slide 19 in a presentation Margaret Hamilton describes three primitive control structures. My goal is to reduce the probability of errors in my code by working with this "design framework". I am ...
0
votes
1answer
37 views

two repositories with kind of different behavior serving same object

I have a simple object like this public class Book { public List Chapters { get; private set; } public TableOfContent BookTOC { get; set; } public string Identifier { ...
4
votes
1answer
90 views

How to load environment configuration

In Java the typical way of storing configuration is by using property files. So I have several such files, one for each environment type (dev, test, prod, ...). This configuration is needed in ...
5
votes
1answer
65 views

In the IEEE/EIA 12207.1-1997 Standard, what does “notation for description” refer to?

The IEEE 12207.1-1997 guide (Software life cycle processes - life cycle data) has a list of general content requirements for all description documents (section 5.1, page 12). This includes "notation ...