Jayesh Bhoot's Ghost Town

Effective Scala, part 2 - domain modelling

Posted on in

Finding the right level of abstraction is more important than the best level of abstraction.

For example, in a problem involving doors and windows and facades, if the domain is constrained to only deal with surface area, then modelling the doors and windows and facade in terms of Rectangle is the right level of abstraction instead of modelling them as Door, Window, and Facade respectively.

Post author's photo Written by Jayesh Bhoot