The
Clean Code book by Robert C. Martin has great points about system boundaries. In chapter 8 titled
Boundaries and in the section called
Using Third-Party Code, the book shares why and how to wrap 3rd party code.
Points For Why To Wrap Third Party Code (page 115):
- The third party code can evolve
- Your wrapper's interface can be made to precisely suit your application's needs
Like the book says on page 115, "If you use a boundary interface like Map, keep it inside the class, or close family of classes, where it is used."
That's huge! I also like the "Sensors" class example which has a method that will give you a "Sensor" class. Sensors giving you a Sensor, implies a naming rule-of-thumb which I also like.
This goes for Grails too. I think that service plugins should also be wrapped.
ReplyDelete