Questions about problem solving and planning for a solution through software design.
-2
votes
4answers
200 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 ...
3
votes
2answers
178 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 ...
4
votes
3answers
93 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 ...
0
votes
0answers
9 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 ...
3
votes
2answers
77 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 ...
1
vote
2answers
63 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 ...
4
votes
2answers
178 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
180 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 ...
3
votes
2answers
75 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 ...
3
votes
3answers
182 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 ...
9
votes
3answers
149 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 ...
3
votes
7answers
209 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 ...
3
votes
7answers
259 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 ...
2
votes
1answer
145 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 ...
3
votes
2answers
89 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
1answer
136 views
What is meant by Distributed Systems Coding interview questions
I was told that I will be asked coding questions in my interview and that the context will be related to Distributed Systems (I took ONE Distributed Systems course and I don't even remember much from ...
0
votes
2answers
257 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 = ...
1
vote
1answer
99 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
1answer
67 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
77 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
89 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?
...
5
votes
3answers
243 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 ...
7
votes
3answers
621 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
0answers
20 views
Generic file parser design in Java using the Strategy pattern [duplicate]
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 ...
2
votes
0answers
58 views
Source and destination arguments order in methods [closed]
I have a rather simple question.
I'm planning file management interface, so I have two methods: put - to put file from source to some destination, and write - to write source data to some file ...
0
votes
3answers
220 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
3answers
305 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
68 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. ...
0
votes
0answers
40 views
Multi tenancy like problem in a single application
I have a web site that is, at a simple level, a document that contains a series of forms and a workflow as to how that document is managed. There are other systems which are outside of the document ...
5
votes
2answers
164 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 ...
3
votes
0answers
313 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 ...
8
votes
3answers
537 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
245 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
86 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
96 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 ...
3
votes
3answers
281 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 ...
0
votes
0answers
34 views
Domain modelling & nested many-to-many relationships with pure ADO.NET
I am to develop a user maintenance application. Not having a whole lot of experience, I'm coming across some issues while building the service layer (WCF) regarding the architecture, domain models, ...
1
vote
2answers
114 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
86 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
165 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 ...
2
votes
1answer
85 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
193 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 ...
3
votes
3answers
105 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
1answer
48 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. ...
4
votes
3answers
173 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 ...
3
votes
1answer
223 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
108 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 ...
1
vote
3answers
140 views
Effective design analysis
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
182 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
88 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:
...