Best practices for creating libraries that use .NET namespaces

后端 未结 6 962
失恋的感觉
失恋的感觉 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

    You pose an excellent question. The answer is: it depends. In the case of standard libraries that will always be available, then it's fine; the core library references different .DLLs all the time.

    In the case of a third party library you run into issues. It's not always a good idea to roll your own if something else does what you want, but then you have a dependency on another library, which is a logistical problem for users.

    There's no right answer here, you just have to go with what makes the most sense for your project. Try to decouple as much as possible, yes, but sometimes you just gotta cuddle up and get the job done.

提交回复
热议问题