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

learn more… | top users | synonyms (1)

12
votes
3answers
23k 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 ...
4
votes
7answers
853 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
528 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
924 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
919 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
9k 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
715 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
3k 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
387 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
418 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
8k 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 ...
10
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
461 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
447 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
102 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
274 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
957 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 ...
12
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
441 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
364 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
128 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
1k 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
231 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
142 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
545 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
319 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
522 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
478 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. ...
5
votes
3answers
366 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
860 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
394 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
985 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
152 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 ...
43
votes
6answers
3k views

How safe are hidden AJAX requests that fake performance?

What is a hidden AJAX request? I've noticed an increase in the usage of hidden AJAX requests designed to make a user's action appear to happen immediately. I'll refer to this type of AJAX request as ...
3
votes
2answers
288 views

Under which area of Artificial Intelligence is my knowledge store?

I've a maturing idea regarding a knowledge store. For the purposes of this question, the store would be used by a police force for the recording and querying of crimes. I believe that ...
4
votes
3answers
474 views

Why is it so difficult to know where to use interfaces,generics in program design?

I am attempting to learn c# from the head first series, in addition i also consult other books such as Pro C# by Andrew Tolson. Now the thing is that i perfectly understand the interface,generics ...
2
votes
6answers
1k views

Why is an interface in Java not allowed to have state? [closed]

There must be a good reason why Java designers didn't allow any state to be defined in interfaces . Can you please throw some light on this aspect of design decision ?
2
votes
3answers
356 views

RESTful Design: Multiple Relationships Between the Same 2 Entities

I am in the process of designing RESTful web services and got stuck at one point. The design is very simple with 3 entities: - Project - Status - Employee The part I am having trouble with is ...
3
votes
1answer
730 views

Can Objective C categories serve the same purpose as Traits do in Scala?

The statement of the question seems little abstract to me, so please read the details below. Since the time when C++ was the first choice Object Oriented Language for almost anything, we had a big ...
3
votes
2answers
312 views

Overcoming circular reference

I am working on an asp.net MVC web application which contains several projects. One is BusinessObjects, which contains business logic / processes. Another is EmailGeneration which is used to send ...
4
votes
2answers
293 views

Ensuring conceptual integrity in Python project with multiple programmers

One objection that I have often heard raised against Python that it is difficult to synchronize a team of many programmers on large Python project. Note: that synchronization is possible in such a ...
0
votes
1answer
470 views

How to structure our Javascript so that it is easily editable, testable, and can make calls to render a view without knowing specifics about the view

I am working on a web app that displays some data and uses javascript. Right now, we are serving up parts of our js (to display certain types of information, ie "Render a View") via our server which ...
10
votes
1answer
3k views

Are we using the repository pattern right?

We are using a bunch of separate classes suffixed with -repository to retrieve the data from the database; for each table its own repository. We have for instance a customerrepository class which has ...
3
votes
2answers
318 views

Can I apply SOLID concepts to entire solution designs rather than just the internal components?

So maybe the quick answer is 'Yes' absolutely (or no I suppose), but let me explain my question angle to get a better derived answer. We all commonly use SOLID design principals when making up the ...
4
votes
3answers
802 views

Is there a design pattern to solve this problem?

I've been struggling with a design so I figured I'd ask here and see if anyone's able to help :) High level overview I'm designing an app to gamify exercise by creating mini competitions (ex. Who ...
8
votes
3answers
2k views

How do you handle multiple users editing the same piece of data in a webapp?

There's a project I'm working on that is looking to produce a web application that will manage a task list between multiple users. This is a master task list whose task items get distributed by an ...
4
votes
3answers
347 views

How to refactor “nested” view classes to avoid deep method calls?

Lets say I'm displaying a bunch of data (model) using a View class for rendering. However, a lot of the data has sub-data (models) complicated enough to require separate rendering classes. In my ...