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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T13:28:18+00:00 2026-05-24T13:28:18+00:00

I have 2 projects: A and B that should interactwith each other. Project A

  • 0

I have 2 projects: A and B that should interactwith each other.

  1. Project A introduce interface names ISpecialTask and Project B should implement it.

  2. Projet B has an entity named TaskWithListOfProperties that cannot implement ISpecialTask because it has different structure of properties (in addition, all the system knows how to work with TaskWithListOfProperties and I don’t want to change its structure).

So I decided to create a class named SpecialTaskFromListOfProperties that implements ISpecialTask and uses TaskWithListOfProperties instance in order to use it for the interaction between the projects.

interface ISpecialTask {
    long Id{get;}
    long WorkerId{get;}
    long VehicleId{get;}
    long CustomerId{get;}
}

class TaskWithListOfProperties {
    IDictionary<string, long> Properties {get;
}

class SpecialTaskFromListOfProperties : ISpecialTask  {
    public SpecialTaskFromListOfProperties(TaskWithListOfProperties  ins) {
        ...
        ...
    }
    public long Id { get{ ... } }
    public long WorkerId { get{ ... } }
    public long VehicleId { get{ ... } }
    public long CustomerId { get{ ... } }
}

Is SpecialTaskFromListOfProperties actually the Adapter pattern?
What is the difference between the adapter pattern and decorator pattern?

  • 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-24T13:28:19+00:00Added an answer on May 24, 2026 at 1:28 pm

    Depends on what you’re actually trying to achieve. Adapter and Decorator are pretty much similar, however when you implement an Adapter you bring no new logic besides conversion. When implementing a Decorator you actually bring in some brand new functionality that never existed before in the object you’re decorating.

    So, long story short, should interface properties Id, WorkerId etc be naturally coming from TaskWithListOfProperties – then you should consider it as an Adapter. Otherwise it’s a Decorator.

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

Sidebar

Related Questions

Background : I have a asp.net webapplication project that should contain a public and
I am making a project that should compile on Windows and Linux. I have
I'm starting a web project that likely should be fine with SQLite. I have
One of the items in the Joel Test is that a project/company should have
I have some projects that run on custom hardware. Now the hardware has changed,
We have two projects that are both class libraries. Project 1 is a VS
Let's say I have four projects: Project A (has a dependency on B and
I have projects that need to be build with a specific version of the
We have many projects that use a common base of shared components (dlls). Currently
Given a situation where you have 2 projects that in total will provide enough

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.