0
votes
1answer
151 views

Technical example of modeling a domain with OOD?

Considering favoring composition over inheritance and looking at various design patterns there are multiple approaches to modeling a domain. Say you have some Entities which are very similar in some ...
1
vote
3answers
282 views

Pattern for costly precondition check before acting

Let's say I have a method DoTheThing() which requires the precondition-check CanTheThingBeDone() to return true. The latter method is time consuming as it accesses the database. I'm finding it hard ...
1
vote
1answer
159 views

Component design: getting cohesion right

I currently have a set of components named DataValues, ValueParsers, ValueFormatters and ValueValidators. The first one defines an abstract base class DataValue and contains a whole load of ...
2
votes
3answers
150 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 ...
50
votes
2answers
4k views

Are there any OO-principles that are practically applicable for Javascript?

Javascript is a prototype-based object oriented language but can become class-based in a variety of ways, either by: Writing the functions to be used as classes by yourself Use a nifty class system ...
13
votes
1answer
546 views

Does Liskov Substitution Principle also apply to classes implementing an interface?

LSP states that classes should be substitutable for their base classes, meaning that derived and base classes should be semantically equivalent. But does LSP also apply to classes implementing an ...
9
votes
5answers
1k views

When to stop inheritance?

Once upon time ago I asked a question on Stack Overflow about inheritance. I have said I design chess engine in OOP fashion. So I inherit all my pieces from Piece abstract class but inheritance still ...
2
votes
3answers
627 views

Recommended content for layers

As an expansion from my previous question about using separate projects for seperate layers - Good practice on Visual Studio Solutions I now wish to know if I am putting the right functionality in ...