Best practices for creating libraries that use .NET namespaces

后端 未结 6 960
失恋的感觉
失恋的感觉 2021-02-04 11:59

Is it bad practice to write a library that defines an interface dependent on another library?

I know tight coupling is bad, but does this still apply when using .NET cla

6条回答
  •  别跟我提以往
    2021-02-04 12:24

    With all of my libraries, I return objects that depend only on things in the library.

    I would ask myself why I was writing a library that would depend upon another namespace that was not implicit. It seems to go against the whole "Encapsulation" concept.

    So just by going off of my own reasoning and knowledge of OOP, I would say you are on the right track with returning your own non-dependent object.

提交回复
热议问题