Skip to main content
added 39 characters in body
Source Link
Frits
  • 410
  • 1
  • 3
  • 8

The best way to use a third-party library in your code is to introduce an abstraction class/layer between your code and the third-party library. This has the advantage that you can make clear which functionality you use from the third-party library (you seldom use everything from a third-party library), and also that the classes and types of the third-party library do not leak into your code. That way, you are still in control with your own code.

In his book "Clean Code", Robert Martin writes about this in chapter 8, "Boundaries". HeYou can also gives a trick to 'test'write (unit) tests against the third-party library, which comes in handy whencalls the methods you need and evaluates the responses or actions. That way, you can easily check if the functionality of the third-party library releaseshas changed during an update or upgrade.

The best way to use a third-party library in your code is to introduce an abstraction class/layer between your code and the third-party library. This has the advantage that you can make clear which functionality you use from the third-party library (you seldom use everything from a third-party library), and also that the classes and types of the third-party library do not leak into your code. That way, you are still in control with your own code.

In his book "Clean Code", Robert Martin writes about this in chapter 8, "Boundaries". He also gives a trick to 'test' the third library, which comes in handy when the third-party library releases an update or upgrade.

The best way to use a third-party library in your code is to introduce an abstraction class/layer between your code and the third-party library. This has the advantage that you can make clear which functionality you use from the third-party library (you seldom use everything from a third-party library), and also that the classes and types of the third-party library do not leak into your code. That way, you are still in control with your own code.

You can also write (unit) tests against the third-party library which calls the methods you need and evaluates the responses or actions. That way, you can easily check if the functionality of the third-party library has changed during an update or upgrade.

Source Link
Frits
  • 410
  • 1
  • 3
  • 8

The best way to use a third-party library in your code is to introduce an abstraction class/layer between your code and the third-party library. This has the advantage that you can make clear which functionality you use from the third-party library (you seldom use everything from a third-party library), and also that the classes and types of the third-party library do not leak into your code. That way, you are still in control with your own code.

In his book "Clean Code", Robert Martin writes about this in chapter 8, "Boundaries". He also gives a trick to 'test' the third library, which comes in handy when the third-party library releases an update or upgrade.