Re:The Lava Layer Anti-Pattern
by bglazer on Friday December 19, 2014 @01:44PM
(#8773726)
So would a better solution be to use something like:
[ Parent
| on HN ]
That's the dependency injection[1] way to do it.
Not really, because db is not static. In my example, that Database.write() method would itself be static, and thus you can't pass it in as an argument.
Basically, this concept means that it's static all the way down, from the top layer to the bottom layer.