Integrating third party code

What’s the best way to integrate third party code without cluttering your code? I think we should abstract all the interaction you need into an interface and let a delegates implement those  interfaces.

The advantages are:
1)  Separation of interface and implementation
2) Unit testing by mocking interface rather than mocking third party code.
3) Maintainable code due to single point of contact(package) with third party code.

References:
Delegation pattern
jMock

Advertisements
This entry was posted in Uncategorized. Bookmark the permalink.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s