News for hackers. Stuff that matters.
Re:Scrap Your Cake Pattern Boilerplate: Dependency Injection... by paf31 on Monday October 28, 2013 @06:47PM (#6630372)
Sorry, now I see it - it enables better type inference. Please ignore :)
Re:Scrap Your Cake Pattern Boilerplate: Dependency Injection... by handler on Monday October 28, 2013 @06:51PM (#6630390)
yeah, it is still a similar amount of overhead in typing
Re:Scrap Your Cake Pattern Boilerplate: Dependency Injection... by jarhart on Monday October 28, 2013 @07:43PM (#6630660)
Actually it's not. Only the primitive readers have similar "overhead" as with the implicits approach. Most of the readers are defined by mapping or flatMapping over the primitives (either explicitly or with comprehensions). With the implicits approach all of the "injected" methods need to declare the dependency via the implicit parameter. With the reader approach, only the primitives have to declare it. Compare the implicits version of UserInfo to the reader version. UserRepository doesn't appear anywhere in the signatures of the reader version.