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

learn more… | top users | synonyms (1)

1
vote
1answer
144 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 ...
2
votes
1answer
46 views

Fix a leaky abstraction (type checking)

I have a method that accepts an interface and does type checking on the parameter, and depending upon the type a decision is made to either send an email or an alert public void ...
0
votes
0answers
31 views

Relational or NoSQL Database Design

Disclaimer: I also posted this question on Database Administrators, because I was not sure which was the most appropriate. This database holds assembly instructions data for shipbuilding, later ...
3
votes
2answers
895 views

How is intermediate data organized in MapReduce?

From what I understand, each mapper outputs an intermediate file. The intermediate data (data contained in each intermediate file) is then sorted by key. Then, a reducer is assigned a key by the ...
2
votes
3answers
78 views

How to simplify structure of a monitoring software that uses the Observer pattern?

I am working on a project where I have to monitor the status of an elevator. So far, my design looks like this: We are using a third party library to read and monitor real-time values from the ...
1
vote
0answers
59 views

How Should I Design Models With Deep Relationship Structures?

I am designing a web application in ASP.NET MVC, which uses ADO.NET for the database access. In the past, I generally have put together a series of classes each of which, maps to one table in a ...
2
votes
2answers
48 views

How to reduce redundancy in a service implemented using multilayer architecture while maintaining consistency across the system?

Currently our service is implemented using a multilayer architecture dividing the whole service into three: API Business Persistence However this introduces a lot of redundancy within our system. ...
0
votes
1answer
27 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
2answers
234 views

Best approach for a server configuration data collection and reporting solution from a legacy script?

I have a project which involves collecting config data from windows servers in our (very large) server estate. My manager wants me to collect over 150 data items across all configuration areas ...
1
vote
1answer
54 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
132 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
137 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
250 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
24 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
92 views

Responsibility of the small business logic: in a class or in a method? [on hold]

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
70 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
128 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
656 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
150 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
352 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
65 views

Best Practices: URL Path Parameters [closed]

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
644 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
79 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
78 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
654 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
195 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
103 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
206 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
451 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
50 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
105 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, ...
1
vote
1answer
71 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
418 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
97 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
538 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
81 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
159 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 ...