Design in programming is the act of making particular choices about how best to structure a program, to achieve goals of reliability, maintainability, correctness or ease of use.

learn more… | top users | synonyms

1
vote
4answers
63 views

What are the drawbacks of this “multi-key” dictionary?

I was making a relatively large-scale project in Python as a learning experiment, and in the process I found that it would be useful to have a map (or, in Python, I guess they're called dictionaries) ...
2
votes
1answer
38 views

Parallel Job Consumer

I need to provide a service (either a Windows Service or an Azure Worker Role) which will handle the parallel execution of jobs. These jobs could be anything from importing data to compiling of ...
1
vote
1answer
17 views

“specific case” object that stands for “any object” : is it a good idea ?

I got tired of doing (more or less) this in my rails controllers : class ThingsController < ApplicationController def index @category = Category.find( params[:category_id] ) if ...
1
vote
2answers
33 views

Ruby OO design : how to handle inconsistent state in a mutable class?

Abstract I'd like to have advice on how to : implement methods that rely on a state, when the instance is mutable and may be in an inconsistent state, in such a way that the methods either ...
5
votes
1answer
57 views

Can I get some tips for improving my tokenizer design?

I need some tips on how to improve the design of the following code. Everything works correctly in the program. It takes a string and shows each token the only tokens being numbers and operators. The ...
3
votes
2answers
73 views

Method Of Retrieving Random Value Depending on Type

I was wondering what would be the most appealing way of achieving this goal. I have a blackbox. I give it a supported type and it returns a random value base off of the type. For my supported types, ...
0
votes
0answers
21 views

Fixing data duplication [migrated]

I'm currently doing maintenance on an old order system that has grown into the poster child for bad coding practice. One of the tings I'm dealing with is a lot of data duplication, which I want to ...
2
votes
1answer
103 views

Do I need to delete a vector?

I want to make a graph from input from a text file in the format: vertex1 vertex2 cost time where vertex1 and vertex2 are strings that form an edge and cost and time are the properties of that ...
1
vote
2answers
41 views

Design class to handle calls for support functions

For the following problem statement, I design following classes. Can you please tell me if this is the correct implementation or if there can be a better one? Let's say there is call center with ...
3
votes
2answers
82 views

Initializing complex constant in Constants interface

I'm being forced to use the common anti-pattern of a public interface Constants which many classes in this project implement. Long story short, I need to have a List constant which is pre-populated ...
2
votes
2answers
109 views

Python Pig Latin Translator

This is only my second Python script, so let me have it! If anything seems off in style or implementation, please nit pick away. I want to learn. I know it could've been done in less lines of code ...
2
votes
2answers
120 views

Implementing a Scheduler(something that implements a given schedule)

I am trying to implement a class that implements a given schedule. I am trying to design this Scheduler class so it can be paused and everything. I have just written some example code so I can better ...
2
votes
1answer
127 views

How to separate code into smaller classes using SOLID principles

I have a console application that basically retrieves xml content, writes to the xml file and sends the file to sftp site. This may seem long post but I believe it is simple stuff that need advise on ...
1
vote
1answer
111 views

Class Design - Excel Report

I am working on a C#.Net application that will generate an Excel report from a template. Although the code's not in the app yet, it will pull data from a SQL Server database to populate the report. ...
1
vote
1answer
60 views

Programming a simple clock

Here's the beginnings of some code for a clock that can display in 24 and 12 hours. What could be added to it ? How could I can apply notions such as OOP, model and Enums here ? P.S: Will edit later ...

15 30 50 per page