Scala ではトレイトの相互再帰的合成ができるけれども、それを実際のプロジェクトで使わないのと同じような理由で、 cake pattern による DI も、(まともに機能すると信じて)実際のプロジェクトに使うことはない気がする
The cake pattern works so much better with dynamically typed language with lazy evaluation such as Nix or Jsonnet. In Scala, inheritance of lazy fields is incorrect, the cake is more verbose, and restricted to compile-time specialization.
-
-
Is there "trait composition" in Nix or Jsonnet? I couldn't find that by quick search. Carefully defined lazy fields should work in any dynamic language, IMO, but that's not a point, I think.
-
All inheritance is "trait composition" in Nix or Jsonnet. And there is a correct way to inherit lazy fields that preserves the sharing of computation nodes where bad ways fail badly, causing exponential duplication of state and other effects (ouch).
- 12 more replies
New conversation -
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.
Read my blog!