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 1063867
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T18:50:55+00:00 2026-05-16T18:50:55+00:00

In a current (C#) project we have a 3rd party assembly that contains a

  • 0

In a current (C#) project we have a 3rd party assembly that contains a non-interfaced connection object. Using IoC, etc we can inject this concrete instance into our code, but it is proving a nightmare to unit test, etc. We are using MoQ as our mocking framework so ideally could do with an interface to work off and we don’t want to go down the route of using something like Moles because we would like to minimise technologies.

If we create a interface to mimic desired functionality of the 3rd party connection object and then create an implementor of that interface containing an instance of the 3rd party object then this will allow our code to work off the interface and both our IoC and unit tests will be happy. However in a discussion we’ve gone around in circles as to which design pattern it really is!

So the question is, “Is the situation described above and illustrated in code below a:“

  1. Adapter as we are providing a wrapper to existing functionality.
  2. Proxy as we are provding an interface to something else.
  3. Facade because as part of the process we will be providing a simplified interface to a larger object.

 

namespace ExampleCode
{
    public interface IConnector
    {
       void Open();
    }

    public class ConnectorWrapper : IConnector
    {
       ThirdPartyConnector _instance;

       public ConnectorWrapper(ThirdPartyConnector instance)
       {
          _instance = instance;
       }

       void Open()
       {
         _instance.Open();
       }
    }
}
  • 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-16T18:50:56+00:00Added an answer on May 16, 2026 at 6:50 pm

    This is definitely a facade. I do this all the time to simplify over-engineered APIs.

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

Sidebar

Related Questions

I have a spec in my current project that requires us to advise the
I am using a Cairngorm MVC architecture for my current project. I have several
I am using a 3rd-party rotator object, which is providing a smooth, random rotation
I have a requirement on my current project (a Flex app which will be
I am hosting SpiderMonkey in a current project and would like to have template
OK, another road bump in my current project. I have never had form elements
I have a fairly standard inheritance situation in my current LINQ-to-SQL project. I have
My current project involves deploying an upgraded .exe file that runs as a Windows
My current project is in Rails. Coming from a Symfony (PHP) and Django (Python)
My current project uses NUnit for unit tests and to drive UATs written with

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.