locked
Class Design and Dependency Injection RRS feed

  • Question

  • Understanding that new'ing up a object (not in the BCL) within another object is considered a dependency and shouldn't be done. You should inject an interface instead. but what if you have a statement like this?

    List<myObject> someList = new List<myObject>

    List is part of the BCL but myObject isn't. Is this still considered a dependency on the object it is contained in or is this ok to implement?


    chuckdawit

    Friday, September 7, 2012 10:33 PM

All replies

  • Hi Witdai,

    Yes, I think so. Or else, myObject is an abstract class.

    Have a nice day.


    Ghost,
    Call me ghost for short, Thanks
    To get the better answer, it should be a better question.

    Monday, September 10, 2012 8:47 AM