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

learn more… | top users | synonyms (1)

18
votes
8answers
2k views

What can go wrong if the Liskov substitution principle is violated?

I was following this highly voted question on possible violation of Liskov Substitution principle. I know what the Liskov Substitution principle is, but what is still not clear in my mind is what ...
11
votes
1answer
739 views

How to verify the Liskov substitution principle in an inheritance hierarchy?

Inspired by this answer: Liskov Substitution Principle requires that Preconditions cannot be strengthened in a subtype. Postconditions cannot be weakened in a subtype. Invariants ...
0
votes
1answer
115 views

Map Library: Client-side or Server-side?

As I have already asked here, I have to implement a Multi-Platform Map application. Now I have Mapstraction as an option which uses Javascript to implement the desired functionality. My question is, ...
75
votes
7answers
6k views

Is this a violation of the Liskov Substitution Principle?

Say we have a list of Task entities, and a ProjectTask sub type. Tasks can be closed at any time, except ProjectTasks which cannot be closed once they have a status of Started. The UI should ensure ...
53
votes
10answers
3k views

My proposed design is usually worse than my colleague's - how do I get better? [closed]

I have been programming for couple of years and am generally good when it comes to fixing problems and creating small-to-medium scripts, however, I'm generally not good at designing large scale ...
12
votes
2answers
396 views

Looking for some OO design advice

I'm developing an app that will be used to open and close valves in an industrial environment, and was thinking of something simple like this:- public static void ValveController { public static ...
3
votes
6answers
466 views

How to visualize the design of a program in order to communicate it to others

I am (re-)designing some packages for R, and I am currently working out the necessary functions, objects, both internal and for the interface with the user. I have documented the individual functions ...
2
votes
2answers
258 views

Returning a mock object from a mock object

I'm trying to return an object when mocking a parser class. This is the test code using PHPUnit 3.7 //set up the result object that I want to be returned from the call to parse method ...
2
votes
4answers
406 views

Would Using a PHP Framework Be Beneficial in My Context?

I've just started work at a small start-up company who mainly uses PHP to develop their front-end apps. I had no prior PHP experience before joining, and this has led to my apps becoming large pieces ...
8
votes
4answers
411 views

Rapid prototyping and refactoring

Sometimes when I start a small project (like an android app), I don´t know which approach will work out at the end, and I just go for one approach and give it a try. But if I never used this approach ...
5
votes
4answers
535 views

What types of processes have to be reflected in flowchart?

In visual programming, there are many events which support our application tasks. So, along with user defined processes, should these also be in flowchart or not? What about the constructors of ...
4
votes
4answers
184 views

How to implement isValid correctly?

I'm trying to provide a mechanism for validating my object like this: class SomeObject { private $_inputString; private $_errors=array(); public function __construct($inputString) { ...
3
votes
1answer
1k views

Recovering an anemic domain model into a multitier architecture

I have spent the past several days learning about domain driven design and attempting to apply it to a current project. I decomposed the problem domain into the canonical logical components: domain, ...
36
votes
14answers
14k views

Isn't MVC anti OOP?

The main idea behind OOP is to unify data and behavior in a single entity - the object. In procedural programming there is data and separately algorithms modifying the data. In the ...
0
votes
3answers
268 views

How should compound words be handled when coding? Is there a definitive list of compound words? [closed]

QUESTION: How should you handle compound words when programming? Are there any good lists available online for developers of generally accepted technology-related compound words? I can see how ...
6
votes
2answers
234 views

Rendering design. How can I effectively deal with forward, deferred and transparent rendering?

I have many objects in my game world that all derive from one base class. Each object will have different materials and will therefore be required to be drawn using various rendering techniques. I ...
13
votes
6answers
524 views

Tips about how to spread Object Oriented practices

I work for a medium company that has around 250 developers. Unfortunately, lots of them are stuck in a procedural way of thinking and some teams constantly deliver big Transactional Script ...
2
votes
4answers
454 views

Is extensive documentation a code smell? [closed]

Every library, open-source project, and SDK/API I've ever come across has come packaged with a (usually large) documentation file, and this seems contradictory to the wide-spread belief that good code ...
2
votes
1answer
362 views

Tiling Problem Solutions for Various Size “Dominoes”

I've got an interesting tiling problem, I have a large square image (size 128k so 131072 squares) with dimensons 256x512... I want to fill this image with certain grain types (a 1x1 tile, a 1x2 ...
3
votes
5answers
809 views

“TDD is about design, not verification”; concretely, what does that mean?

I've been wondering about this. What do we exactly mean by design and verification. Should I just apply TDD to make sure my code is SOLID and not check if it's external behaviour is correct? Should ...
6
votes
3answers
578 views

How can I get better at explaining complex software processes to developers?

I'm really struggling with my software specs. I am not a professional programmer but enjoy doing it for fun and made some software that I want to sell later but I'm not happy with the code quality. ...
1
vote
2answers
249 views

Is it better to define all routes in the Global.asax than to define separately in the areas?

I am working on a MVC 4 project that will serve as an API layer of a larger application. The developers that came before me set up separate Areas to separate different API requests (i.e Search, ...
3
votes
2answers
956 views

How is it possible to write the compiler of a programming language with that language itself [duplicate]

Possible Duplicate: How could the first C++ compiler be written in C++? You probably heard that Microsoft released a new language called TypeScript which is a the typed superset of ...
10
votes
3answers
2k views

Am I wrong in thinking that needing something like AutoMapper is an indication of poor design?

Automapper is an "object-object mapper" for .Net, which means copying objects from a class into another class that represents the same thing. Why is this ever useful? Is the duplication of classes ...
4
votes
1answer
166 views

Why is nesting or piggybacking errors within errors bad in general?

Why is nesting or piggybacking errors within errors bad in general? To me it seems bad intuitively, but I'm suspicious in that I cannot adequately articulate why it is bad. This may be because it is ...
6
votes
1answer
241 views

Event Aggregator.. not getting a response, how to determine completion?

I'm rewriting a vehicle tracking application, a google maps based thing.. The users are able to search for a vehicle by typing a few characters of the vehicles "callsign". My application is based ...
8
votes
1answer
5k views

python factory function best practices

Suppose I have a file foo.py containing a class Foo: class Foo(object): def __init__(self, data): ... Now I want to add a function that creates a Foo object in a certain way from raw ...
-2
votes
2answers
882 views

ASP.NET MVC Controller separation best practices [closed]

I am very new in ASP.NET MVC and Web stuff. I want to know how I should separate my page logic into different controllers. Like for example should I use Home\BuyProduct or Product\Buy. When there is a ...
0
votes
3answers
153 views

Best practice to propagate preferences of application

What is your approach with propagation to all classes/windows of preferences/settings of your application? Do you share the preference_manager class to all classes/windows who need it or you make ...
4
votes
1answer
725 views

When is a Use Case layer needed?

In his blog post The Clean Architecture Uncle Bob suggests a 4-layer architecture. I understand the separation between business rules, interfaces and infrastructure, but I wonder if/when it's ...
7
votes
1answer
513 views

High resolution graphical representation of the Earth's surface

I've got a library, which I inherited, which presents a zoomable representation of the Earth. It's a Mercator projection and is constructed from triangles, the properties of which are stored in ...
50
votes
12answers
4k views

Is it bad practice to pass instances through several layers?

In my program design, I often come to the point where I have to pass object instances through several classes. For example, if I have a controller that loads an audio file, and then passes it to a ...
25
votes
4answers
3k views

TDD - Outside In vs Inside Out

What is the difference between building an application Outside In vs building it Inside Out using TDD? These are the books I read about TDD and unit testing: Test Driven Development: By Example ...
7
votes
4answers
384 views

How to prevent duplicate data access methods that retrieve similar data?

In almost every project I work on with a team, the same problem seems to creep in. Someone writes UI code that needs data and writes a data access method: AssetDto GetAssetById(int assetId) A week ...
2
votes
1answer
85 views

String patterns that can be used to filter and group files

One of our application filters files in certain directory, extract some data from it and export a document from the extracted data. The algorithm for extracting the data depends on the file, and so ...
24
votes
4answers
1k views

How to explain why design choices are good?

As I've become a better developer, I find that much of my design skill comes more from intuition than mechanical analysis. This is great. It lets me read code and get a feel for it quicker. It lets me ...
3
votes
1answer
519 views

What is the best way to diagrammatically represent a system threading architecture?

I am yet to find the perfect way to diagrammatically represent the overall threading architecture for a system (using UML or otherwise). I am after a diagramming technique that would show all the ...
2
votes
2answers
662 views

Is switch-case over enumeration bad practice?

I have an enumeration with the commands Play, Stop and Pause for a media player. In two classes I do a switch-case over the received commands. The player runs in a different thread and I deliver the ...
2
votes
2answers
863 views

Removing an element not currently in a list: ValueError?

This is something that's bothered me for a while, and I can't figure out why anyone would ever want the language to act like this: In [1]: foo = [1, 2, 3] In [2]: foo.remove(2) ; foo # okay Out[2]: ...
4
votes
1answer
915 views

Designing a system with different business rules for different customers

My company is rewriting our proprietary business application. The current architecture is poorly done and inflexible. It is coded more procedural oriented as opposed to object oriented. It has become ...
0
votes
2answers
308 views

Software Architecture - From design to sucessful implementation

As the subject goes; once a software architect puts down the high level design and approach to a software that is to be developed from scratch, how does the team ensure that it is implemented ...
2
votes
2answers
1k views

What norms/standards should I follow when writing a functional spec?

I would like to know what documents (ISO?) should I follow when I write a functional specification. Or what should designers follow when creating the system design? I was told that there was a ...
4
votes
1answer
544 views

is it allowed to create a app with overscroll feature?

As Apple won lawsuits against Motorola and Samsung with the so called overscroll patent, I am asking myself what the legal consequences of releasing an application with such a feature are? I think if ...
1
vote
1answer
242 views

design pattern advice: graph -> computation

I have a domain model, persisted in a database, which represents a graph. A graph consists of nodes (e.g. NodeTypeA, NodeTypeB) which are connected via branches. The two generic elements (nodes and ...
5
votes
3answers
536 views

What should be the minimal design/scope documentation before development begins?

I am a junior developer working on my own in the programming aspect of projects. I am given a png file with 5-6 of the pages designed, most times in specific detail. From this I'm asked to develop ...
13
votes
5answers
6k views

Are UML class diagrams adequate to design javascript systems?

Given that UML is oriented towards a more classic approach to object orientation, is it still usable in a reliable way to design javascript systems? One specific problem that I can see is that class ...
7
votes
3answers
601 views

Integrating with a payment provider; Proper and robust OOP approach

History We are currently using a so called redirect model for our online payments (where you send the payer to a payment gateway, where he inputs his payment details - the gateway will then return ...
26
votes
9answers
2k views

Simple vs Complex (but performance efficient) solution - which one to choose and when?

I have been programming for a couple of years and have often found myself at a dilemma. There are two solutions - one is simple one i.e. simple approach, easier to understand and maintain. It ...
5
votes
6answers
347 views

Depending on fixed version of a library and ignore its updates

I was talking to a technical boss yesterday. Its about a project in C++ that depends on opencv and he wanted to include a specific opencv version into the svn and keep using this version ignoring any ...
4
votes
2answers
1k views

Caching factory design

I have a factory class XFactory that creates objects of class X. Instances of X are very large, so the main purpose of the factory is to cache them, as transparently to the client code as possible. ...