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

learn more… | top users | synonyms (1)

0
votes
4answers
342 views

How do I deal with global variables in existing legacy code (or, what's better, global hell or pattern hell)?

So... We have this fairly big project (~5k LOC, but there's duplicated code so it's hard to tell) with literally hundreds of global variables. The project has more dependencies on other projects, and ...
3
votes
2answers
156 views

messaging class and global state

This is a front end project that is using socket.io for all communication with the server. This allows for push which is good, but recently we have been asked to provide a pause button. The pause ...
1
vote
2answers
128 views

Validating objects with each other - Design Pattern needed

I am running a zoo application. My zoo includes an abstract class of 'animal', and several deriving classes - 'zebra', 'elephant', 'orangutan', 'baboon' and so on. Of each class I have several ...
3
votes
1answer
216 views

Is it bad to have classes as properties of all other classes?

I've been making MVC programs for work (I'm an intern) and I feel like I'm doing a pretty good job at abstraction, single responsibility, etc. But I have this feeling about how I keep making objects ...
3
votes
1answer
122 views

implementing dynamic query handler on historical data

EDIT : Refined question to focus on the core issue Context: I have historical data about property (house) sales collected from various sources in a centralized/cloud data source (assume info ...
1
vote
3answers
227 views

Why does Rails do config in code?

According to the Pragmatic Programmers, code should be for abstractions, while configuration and details should live in metadata. Rails seems to diverge dramatically from this pattern. Much config is ...
2
votes
2answers
188 views

I'm struggling with abstracting my animation code in my game using a functional style. How can I do this?

My game is a top down 2D shmup programmed in a functional style. I'm struggling with abstracting the code that is responsible for animating the projectiles. There are many types of guns with many ...
6
votes
3answers
342 views

Are “Stocks” a TDD/Unit testing anti pattern?

From Martin Fowler's Mocks Aren't Stubs he states that Stubs provide canned answers to calls made during the test while Mocks objects pre-programmed with expectations which form a specification of the ...
1
vote
0answers
64 views

Using streams as method parameters and/or return types

So let's say I have a 'Transformer' interface that can transform one file-type to another. Let's say I also wish to use streams to provide the data to the Transformer. Which is the approach that is ...
2
votes
2answers
159 views

Pattern for multiple datasources

I've already read this question on CodeReview. I was hoping for general advice. I'm writing a service which will go to numerous data sources. Each source requires getting copious amounts of data ...
0
votes
1answer
558 views

Is this proper OO design for C++?

I recently took a software processes course and this is my first time attempting OO design on my own. I am trying to follow OO design principles and C++ conventions. I attempted and gave up on MVC for ...
0
votes
0answers
27 views

DSL enabling users to reference forms and records to display?

There are three main "unique" components to my system: Visual form builder (AngularJS backed); generates an id CRUD automatically available for it at /form_type/id "Aggregate page"; with a form ...
0
votes
0answers
58 views

Inputs and outputs to a method mixed in the UI

I am designing the front end of an WPF application using MVVM where basically all we are doing (for now) is calling a method with some inputs and displaying the outputs. There are two types of ...
2
votes
3answers
363 views

Is a degree in CS and a degree in SE the same thing? [closed]

I asked a question here, trying to understand the fundamental differences between Computer Science and Software Engineering. However, so far I'm having no luck getting an answer (Feel free to help ...
1
vote
3answers
151 views

Should I consider loosely-coupling for class methods as well? [duplicate]

I'm a fan of Dependency Injection, however I don't know how much both public and private methods inside a class should be loosely-coupled. Just to picture it better, when I have both projectId and ...
0
votes
2answers
204 views

Fail-fast design [duplicate]

I recently tend to design my methods in the following way: if ( 'A' === $a ) { if ( 'B' === $b ) { return 'some thing'; } else if ( 'C' === $c ) { return 'some other things'; ...
0
votes
0answers
60 views

How to Detect Sprites in a SpriteSheet?

I'm currently writing a Sprite Sheet Unpacker such as Alferds Spritesheet Unpacker. Now, before this is sent to gamedev, this isn't necessarily about games. I would like to know how to detect a sprite ...
5
votes
1answer
226 views

Layers and layers of SOAP

I am designing the back-end to a SOAP web-service and have a question about how I am thinking of doing it. I am going to go with a simple layered design which consists of 3 separate layers. Layer 1 ...
0
votes
2answers
148 views

Is it better to use already build plugins/extensions or code your own in programming projects [duplicate]

I am building a web app in PHP and Symfony. Basically if we search there are plugins / extensions / bundles for almost 60% of stuff. The advantage of using them is that you can easily get your ...
37
votes
9answers
3k views

Do we need Logging when doing TDD?

When doing the Red, Green & Refactor cycle we should always write the minimum code to pass the test. This is the way I have been taught about TDD and the way almost all books describe the process. ...
1
vote
2answers
166 views

Minimize touching the already-working code when a radical change is required

I have a code that highly relies on an Array structure like the following: $array['customer'][$customer_id]['details'][..]; // it goes to about 10 levels deep However, after almost two years ...
0
votes
3answers
171 views

Stopping spiders or unauthorised users from viewing files

I am stumped at this problem. Users authenticate at my client's website. Then the users see their profile page on my client's website. My client now wants me to provide a URL on their profile page, ...
1
vote
2answers
141 views

Refreshing website design and architecture

I have a website that is build with asp.net web forms. I would like to refresh design (using css, html5, responsive design) and also change it from web forms to asp.net MVC. To me this is more of a ...
1
vote
0answers
90 views

Problem with Vi editor using PuTTy [closed]

For my computer science class for intro to c/c++ we are using the PuTTy client to work with Vi. During one of my assignments I was in the other room and apparently my cat jumped up on my laptop and ...
0
votes
2answers
87 views

Design principles : classifying different types of class [closed]

I'm trying to clarify the design of a C++ application, and would like to define a clear classification among classes to aid clarity. However I'm struggling to find any literature to help me, probably ...
1
vote
2answers
149 views

Should I always start with UML as a good practice when designing classes?

I am in the middle of creating a Bundle for PHP application based on Symfony 2. I want the bundle to be clear and good designed, so I constantly move and refactor code, rename methods, reorder ...
1
vote
0answers
59 views

On the process of replacing an internal framework by a public one [duplicate]

I am working on several applications which depends on a framework which was developed by a prior engineer in the company. The framework was mainly developed and maintained in the early 2000s, and ...
0
votes
2answers
46 views

How to design routes for generalized/specialized resources

I hope I can explain what is troubling me. Example: I have an object basket with a list of fruit objects. So normally I would build my routes like this baskets/{basketId}/fruits/{fruitId). But fruit ...
2
votes
2answers
102 views

Handling login errors with User Class

We have a User class which handles all things related to users within a Content Management System. As you'd expect, the class contains a function login(). This function accepts three arguments: ...
0
votes
1answer
84 views

Use global variables or methods in an API's frontend

I am currently designing a graphics library in Java and now it's come to making the frontend I am curious why I have never seen libraries using global variables for their settings/properties - in-fact ...
2
votes
4answers
219 views

What are some good ways to represent relationship among three numbers

I'm trying to find a clean, intuitive way to implement this problem. Basically, I have three numbers, and based on relationship (less than, greater than, and equal to) among these numbers would change ...
0
votes
1answer
56 views

Pythonic design for controlling multiple devices through an I2C bus

I'm writing a piece of software in python that will communicate with a bunch of devices via an I2C bus. Each of these devices are going to need some sort of a module or class to handle the ...
3
votes
1answer
342 views

Why doesn't VB.NET allow unnamed, one-line objects to be used?

Why isn't this allowed in VB.NET: New SqlCommand("some string", someSqlConnection).ExecuteNonQuery() Why would the language have been designed to require that this be used instead: Dim com As New ...
50
votes
6answers
4k views

How to manage accidental complexity in software projects

When Murray Gell-Mann was asked how Richard Feynman managed to solve so many hard problems Gell-Mann responded that Feynman had an algorithm: Write down the problem. Think real hard. Write down the ...
2
votes
0answers
51 views

What are some important considerations when developing a DBaaS (DataBase as a Service)

I'm interested in creating a Database as a Service. I want users of the service to be able to do a few seemingly not very simple things. Sign up and be given access to a JSON datastore that they can ...
18
votes
2answers
2k views

How to improve upon Bloch's Builder Pattern, to make it more appropriate for use in classes that may be extended and sub-extended many times over?

I have been greatly influenced by Joshua Bloch's Effective Java book (2nd edition), probably more so than with any programming book I've read. In particular, his Builder Pattern (item 2) has had the ...
1
vote
2answers
117 views

Code Duplication in Multi-Module Project

I've about seven modules arranged like so: Service Processing Common Account Email Scheduling I try to make it my policy to restrict code to the module that actually uses it. Code that is shared ...
0
votes
3answers
276 views

Interfaces vs Base class [duplicate]

I'm strugging to know when to use a base class with Polymorphism or an interface. Providing my object exposes DoThis() then I can't see why it matters if it's an interface of a base class. Please ...
2
votes
2answers
117 views

Entity Translation Should be in the Data Layer or Business Layer

From my understanding I though the data layer should isolate the Data Technology from the rest of the application, for me this also include the schema in this case the data entity. Recently I've been ...
4
votes
2answers
285 views

How to enrich a simple two endpoint SOAP application to become enterprise level?

Imagine you have some exchange of data between two endpoints (webservices or let's call URL). Data can travel in any way (Xml, Json, GET, POST) it doesn't matter. I've got the source code of the ...
3
votes
2answers
206 views

It is bad practice to hard couple logging interface/implementation with business model classes?

Should we avoid using logging in business model classes and try to move logging to service/controller classes? In for example java context, logging in model classes will hard couple the code with ...
0
votes
0answers
31 views

Inventory Management project Unit of measurement conversion issue

We are currently working on an inventory module. We have purchase requisition, purchase order, goods receipt modules etc. There is obviously the need for UOM or Unit of measurement conversion needed. ...
0
votes
0answers
29 views

JMS for synchronous calls vs leaving homebrewed messaging system?

I'm refactoring existing code. Right now the code has a main server with a CLI and restful interface as seperate applications which communicate with the server via a home-brewed message passing ...
1
vote
2answers
256 views

What is best software design in creating methods?

I had created a extension method which extended the string type in C#. // actually checks if the string is empty or null and then looks up the default // promotion code which is set in the backend ...
4
votes
2answers
282 views

What is Component Oriented Programming, and how is it different from OOP? [closed]

What exactly is Component Oriented Programming, and how is it different from Object Oriented Programming? Thanks
1
vote
1answer
55 views

Separate domain entity in small ones

I have the Customer entity, this entity has a huge list of attributes, so you are thinking in separate in small entities (for example: "basic info", "document", "declarations", etc). This approach ...
2
votes
2answers
97 views

Form cancellation. Where should any data rollback occur?

You have a form that has an object injected into it. The user interacts with the form and updates the injected object via the UI. If the user then 'Cancels' the form, whose responsibility is it to ...
0
votes
2answers
303 views

iOS chat application design, sending/relaying the message over to the end user

I have a design question. Let us say you were tasked with building a chat application, specifically for iOS (iOS Chat Application). For simplicity let us say you can only chat with one person at a ...
2
votes
0answers
88 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 ...
3
votes
2answers
233 views

Object-Oriented design and proper Java architecture for my program

This is the very first time that I think I want to create a program which really uses OOP principles and I want to do it in the most effective and efficient way. First of all we are given this ...