Comment

Comment by pan69

>> There is a second form of Dependency Injection that uses setters instead of constructor injection. Do not use this form.

Why? Personal preference I guess? Constructor injection works fine for low level objects that only take 1 or 2 dependencies, but for higher level business objects that might have a wider dependency reach, constructor injection can become a nightmare.

parent pan69 11 years ago

Discussion

Live from the official Hacker News API

A modern reader for Hacker News · SvelteKit + Skeleton