Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7650365
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T11:14:02+00:00 2026-05-31T11:14:02+00:00

I have a requirement to add a layer between an external library and client

  • 0

I have a requirement to add a layer between an external library and client code, such that the client has a consistent interface to the underlying library and we are able to switch out the library with the minimum of code changes.

For example:

public interface IConsistentInterface
{
    void Foo(string bar);
    void Bar(string foo);
}

Internally the concrete implementation of this interface will be calling into the library, using whatever functionality that offers. This way if we switch out the library, we just need to change the internal calls of concrete types of this interface.

This looks to me like the Adapter pattern, but is this the best approach to the problem?

Thanks.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-31T11:14:03+00:00Added an answer on May 31, 2026 at 11:14 am

    It seems like the Gateway pattern might fit nicely here. However, as you say, the Adapter pattern can also work well for you. In fact, thinking about it there seems little difference between how the two might look in code.

    You can’t go wrong normalising the external API into another API your code can consume consistently. If changes occur in the external API, the breaking code will be limited to your normalised API, where you can either do a fix or damage limitation. The net effect, and the one both patterns aim for, is a much reduced surface area of impact on the rest of your code.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a code that will connect to a external ASMX service. THe requirement
I have a requirement to add conditional disabled & class attributes to a dropdown
Can i add two header text in Datagrid? My Requirement is to have two
I have requirement like, suppose I have a 'property' table which has 'ListingKey' field
In our project we have requirement that, after receiving sms message from third party
I have a requirement to make a large amount of code MISRA compliant. First
We have a requirement to add an event reminder when a user enters their
In my native iPhone Application, I have a requirement to add a reminder to
I have a requirement to programmatically add a file along with metadata to a
I have a requirement that i need to set the connection into the hibernate,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.