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

learn more… | top users | synonyms (1)

2
votes
5answers
775 views

Why sequential cohesion for operations in a method is not a good idea?

I read from the seminal Code Complete book that method statements that require to be executed in order passing parameter from one to the next is a code smell and is an example of a sequential ...
6
votes
3answers
505 views

Should a method's parameter list contain objects or object identifiers?

Our teams is having the following discussion: Let's say we have the following two methods: public Response Withdraw(int clubId, int terminalId,int cardId, string invoice, decimal amount); public ...
5
votes
1answer
840 views

Explanation of Object-parameter-coupling as mentioned in Code Complete book

I have been reading up on the seminal and excellent book Code Complete. It discusses about the various kinds of couplings that can happen between modules(which may be classes as well as methods): ...
4
votes
3answers
387 views

Which of these OOP examples demonstrate proper OOP concepts?

I'm still trying to wrap my head around OOP. All of the following examples work, of course, but is there one (or possibly another) that best exemplifies OOP concepts? /** * For the following ...
-2
votes
4answers
412 views

Will a program ever crash if the main loop is put in a try/catch block [closed]

If we have a class main and the constructor of main constructs our setupclass and we put this class in a try catch in main. Theoratically Will all errors go into catch? If they will how will it ...
4
votes
2answers
298 views

What is the preferred way of communicating between applications on the same system?

I'm designing a system that is built on several small applications written in python, some of these will be services and others will be programs that only run during special situations. What I need to ...
6
votes
3answers
197 views

Why would each widget need a reference to its parent in a simple widget system?

I'm working on a simple widget system (single window, fixed size). Each widget gets its parent (i.e. the widget containing it) passed into its constructor - except for the root widget, which I called ...
1
vote
1answer
166 views

Azure Storage Table design with multiple query points

I have the following Azure Storage Table. PositionData table: PartitionKey: ClientID + VehicleID RowKey: GUID Properties: ClientID, VehicleID, DriverID, Date, GPSPosition Each vehicle will log ...
4
votes
2answers
107 views

What is the better way to design flexible menus?

I would like to have a menu like this in surfdome. I don't mean the UI but the flexibility of this menu. I will try to explain it. I have some products. I want to match these products with some ...
2
votes
2answers
313 views

Mock up class object

For example I have class ItemDownloader which has method downloadItem. This method creates instance of another class - Download to perform actual downloading. Question is: I want to test ...
3
votes
2answers
330 views

Preventing Liskov Substitution violation

I am reimplementing some component and noticed that the original version has a Liskov Substitution violation. It's not all that critical, though I'd like to get rid of it in the new implementation . ...
4
votes
3answers
226 views

Using the mouse as a multi-tool creates heavy conditional logic for executing commands, how do I change this?

The feature is in many different types of editing programs where a mouse click may have completely different commands to execute (using the Command Pattern) Currently I have an overarching ...
4
votes
2answers
406 views

Design strategies for storing and validating serial numbers

We are writing software to track Foo Widgets. Each Foo Widget has a serial number. The serial number is an 32-character alphanumeric string. The string is separated into five sets. Each set is ...
8
votes
5answers
10k views

Should I use abstract or virtual methods?

If we assume that it is not desirable for the base class to be a pure interface class, and using the 2 examples from below, which is a better approach, using the abstract or virtual method class ...
14
votes
3answers
28k views

Best way to unit test methods that call other methods inside same class

I was recently discussing with some friends which of the following 2 methods is best to stub return results or calls to methods inside same class from methods inside same class. This is a very ...
5
votes
7answers
928 views

Naming guard clauses that throw exceptions

I have a function evaluate() that parses a String for some variables and replaces them with their corresponding value: public String evaluate() { String result = templateText; for ...
2
votes
7answers
556 views

Are design principles important, and if so, why don't more people use them? [closed]

I am a developer who works for an in-house information communications technology (ICT) department. I am usually quite critical when looking over code that I have not written as I find time and time ...
5
votes
2answers
993 views

PHP OOP: Should every object contain all the data?

I'm trying to learn PHP OOP "properly", and I was wondering, should the constructor grab all the information in the database and store it in the object? To use an example I'm trying to create using ...
7
votes
2answers
1k views

Domain Services as facades

I read .NET Domain-Driven Design with C#: Problem - Design - Solution and I noticed that the author created a domain service for each aggregate root. However, the domain services were only facades to ...
0
votes
2answers
11k views

Simple real-world PHP OOP example?

I'm trying to learn PHP OOP, but when I've followed tutorials, all the examples seem to involve things like: class Human { $_sex; public function setSex($sex) { $this->_sex = ...
3
votes
3answers
741 views

Algorithm for tracking progress of controller method running in background

I am using Codeigniter framework for PHP on Windows platform. My problem is I am trying to track progress of a controller method running in background. The controller extracts data from the ...
2
votes
3answers
4k views

Identifying Domain Services & Application Services when doing DDD

-I'm trying to figure out how to identify Application Services in my application. I think I can identify a Domain service by 2 things: It acts as a facade to the repository. It holds business logic ...
3
votes
2answers
402 views

A better workflow between designer and developer on iOS XIB files development

We're working on an iOS project and right now, and whenever the designer has some feedback about fonts, colors, positions of elements, what images should go where etc., I have to go back and go ...
2
votes
1answer
439 views

Domain Driven Design with an EAV database model

How can one apply DDD to a EAV database model? Consider this EAV database model: How am I supposed to build a domain model if all my entities and their attributes will be stored in the database? ...
9
votes
3answers
9k views

Generic file parser design in Java using the Strategy pattern

I am working on a product in which the responsibility of one of the modules is to parse XML files and dump the required content in a database. Even though the present requirement is only to parse XML ...
12
votes
3answers
2k views

What is the principle of least astonishment?

In programming what is called Principle of Least Astonishment? How is this concept related to designing good APIs? Is this something applicable to only object oriented programming or does it permeate ...
0
votes
3answers
534 views

Count true array elements

In my code (Python+numpy or Matlab, but issue can apply to any array programming language), I often need to count the number of elements in an array where the elements are true. Usually, I implement ...
3
votes
2answers
468 views

Proper Git setup between designers and developers?

Basically we now have 2 developers for an iOS project, 2 developers for an Android project and 1 designer doing designs for both projects. Right now, the way we exchange designs and images is through ...
1
vote
2answers
104 views

One Service or Two Services for Parsing and Sending Emails

I have a bulk emailing service within the system which allows for a template to be used. When the mail is sent the template is parsed or run through a parser to replace tags with actual information. ...
6
votes
2answers
306 views

How to do unit tests on a method that takes the elapsed time into account?

I'm currently in the middle of refactoring an important method in a legacy-system. There were almost zero test until I've started working on it, and I've added quite a lot to ensure the correct work ...
4
votes
3answers
1k views

A design pattern for data binding an object (with subclasses) to asp.net user control

I have an abstract class called Address and I am deriving three classes ; HomeAddress, Work Address, NextOfKin address. My idea is to bind this to a usercontrol and based on the type of Address it ...
13
votes
3answers
4k views

How to avoid “managers” in my code

I'm currently re-designing my Entity System, for C++, and I have a lot of Managers. In my design, I have these classes, in order to tie my library together. I've heard a lot of bad things when it ...
6
votes
4answers
462 views

Applying DRY to an inheritance hierarchy

I'm working on refactoring a legacy application where I implemented the State pattern successfully as shown in the following diagram: As you see there is a common behavior between the 3 states, so ...
2
votes
1answer
410 views

User Stories - How should it be defined for complex changes involving multiple applications

This is one of the definitions that I asw for user stories - When the time has come for creating user stories, one of the developers (or the product owner in Scrum) gets together with a customer ...
3
votes
1answer
130 views

Most secure method of asynchronous exchange of randomized loot in a strictly offline ARPG

I'm interested in the conceptual (programming language agnostic problem) process of sending a game object to another player of the game in exchange for another game object without a face-to-face ...
4
votes
3answers
2k views

var args constructors/methods vs lists

In the long debate of using arrays vs lists in the public API of Java classes, I tend to prefer lists in most situations. However, I also found convenient to use var arguments in many constructors and ...
1
vote
2answers
243 views

Would it be bad design to abstract a graphics library and wrap it in a single class? [duplicate]

I'm starting a game project in C++ using the SFML. It provides various classes for handling graphics, input, etc, but I would like to wrap it all up in a single Media class. I believe that by doing ...
1
vote
1answer
151 views

Possible Designs for code block editor

I have started a project where I need to design an application that will work as a code-block editor, much like lego mindstorms and this google project. http://code.google.com/p/blockly/ What are the ...
1
vote
3answers
243 views

About classes and their valid states

I get stuck each time I need to write a constructor for any class I design. The reason is that I am not sure what should go into a constructor and what should not. On googling for this, I got the ...
4
votes
2answers
627 views

In MVP, should presenters instantiate and control other presenters?

I've implemented an application using MVP with GWT, which is working out very nicely for views that have a single purpose. Now, it has evolved into views that are achieving multiple purposes in a ...
-2
votes
1answer
322 views

Should a programmer always be able to do everything a user could do? [closed]

Should a programmer be able to perform all operations programmatically on a object that a user could do? By way of example, I'm working with a list selection object. To populate the list ...
4
votes
4answers
580 views

Should we validate a state transition before attempting it in the State Pattern?

When applying the State Pattern illegal transitions should result in an exception being thrown (or at least that's what I understood from the pattern) I know exceptions are for "unexpected behavior" ...
2
votes
2answers
532 views

Web application (Spring, JSF) forks, how to reuse existing code for subprojects?

my question is going to be somewhat philosophical and "architectural oriented" so bear with me. Right now we have existing Java web application built on top of Spring and JSF(facelets) with maven. ...
6
votes
3answers
389 views

How should I go about “overhauling” a large legacy application? [duplicate]

Possible Duplicate: I’ve inherited 200K lines of spaghetti code — what now? For my next project, I've been tasked with "overhauling" a large legacy web application with many parts. It is a ...
7
votes
6answers
897 views

Design guidelines for this scenario in C#?

I have to create a validation system(I don't want to use Data Annotation or any other system) for my C# application using .Net Compact Framework, where I have an object which contains many other ...
2
votes
1answer
434 views

Shift Javascript framework - What pattern is this? MVP, MVC or something else

I have created a very tiny framework to be able to get away from all the clutter while developing. The point of the framework is not to replace any library of choice but simply segregate the code to ...
0
votes
4answers
227 views

Effective design analysis [closed]

Our team redesigns the legacy software and there are a lot of design meetings going on. Many of them are not very effective and lack good analysis of the proposed design. Is there any formal way to ...
-1
votes
3answers
1k views

Are there any existing standard software design guidelines?

My team of about 70 programmers is developing C and C++ code for embedded, multiprocessor, image-processing project. We have a coding standard, and hold design and code reviews. The problem is that we ...
3
votes
0answers
96 views

Bridge Design Pattern - I still don't get it [duplicate]

Possible Duplicate: Understanding the bridge design pattern I have read lots of material about the bridge design pattern: ...
2
votes
3answers
155 views

Abstracting out a module or using the Module Singleton directly?

I am working on a module which is dependent on other module for some functionality. Now the dependent module provides a lot of functionality and I need only few of them, hence got the idea to create ...