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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T12:22:25+00:00 2026-05-27T12:22:25+00:00

I am designing a library that provides access to the Bug Tracker application our

  • 0

I am designing a library that provides access to the Bug Tracker application our company uses.

For the time being, we simply need access to simple functions:

  1. Open Defect
  2. Query defect (search by given criteria)
  3. Connect/Disconnect from Bug Tracker

I designed the library to provide an interface with these operations, so that we could transparently replace implementations when a new version comes out.

In order to support more operations in the future we could:

  1. Expand the interface; Make all implementing classes implement the added members.
  2. Use the Decorator pattern to add operations/functionality at runtime.

The problem is — Decorator seems to be too tied to the underlying base class/interface.
What i mean is, it relies on the fact that the object it decorates provides enough access to let it add operations easily.

In this example, if i do NOT expose the underlying 3rd party object providing the API for the bug tracker in my interface, a decorator will not be able to add more operations.

How can i overcome this issue by designing it better?

  • 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-27T12:22:25+00:00Added an answer on May 27, 2026 at 12:22 pm

    You don’t need the Decorator pattern

    The decorator pattern isn’t very useful for this scenario. Its purpose is to allow you to append behaviors at runtime. You’re trying to append behavior (more or less) at compile time.

    See: http://en.wikipedia.org/wiki/Decorator_pattern

    This pattern allows the user to create these types of instances of your code:

    • Intentionally undecorated types, that only have the base behavior
    • Arbitrarily decorated types that allow you to provide overridden behavior

    To do this, it incurs a lot of design overhead. For only one decoration, you need to implement four classes.

    This is a lot of overhead if you don’t care about instantiating intentionally undecorated types.

    You might not need to worry about this at all

    I would only worry about this scenario if you’ve already rolled out an interface, and it would be costly to redeploy everything at once (clients and services). If you have the luxury of redeploying the entire world at once, for all users, just modify the interface instead.

    Multiple interfaces are a better match for your scenario

    If you simply want to keep your services and clients running while doing a staggered rollout, I’d recommend you take advantage of the fact that .Net allows multiple inheritance for interfaces, and version your interfaces.

    When releasing a new version that modifies the interface, add a new interface and implement both. Make your objects implement both interfaces.

    This will allow you to stagger rollouts and remain backward compatible. You can deprecate and remove old interfaces at whatever time makes the most sense for your schedule.

    Here’s an example. Note that I didn’t think out the design of the services at all, except with respect to solving your specific problem:

    namespace Version1
    {
        public interface IOpenDefectService
        {
            void Submit(string title, string description, int severity);
            void Bump(int issueId);
        }
    }
    
    namespace Version2
    {
        public interface IOpenDefectService
        {
            void Submit(string title, string description, int severity);
    
            // Removed Bump method - it was a bad idea
    
            // Added an optional priority field
            void Submit(string title, string description, int severity,
                int priority);
    
            // Added support for deleting 
            void Delete(int id);
        }
    }
    
    public class OpenDefectService : Version1.IOpenDefectService,
        Version2.IOpenDefectService
    {
        // Still must support it until you no longer have any clients using it.
        // Here to support staggered rollouts
        [Obsolete("This method is deprecated.  Don't use it")]
        public void Bump(int issueId) { /* Still has implementation... */ }
    
        public void Submit(string title, string description,
            int severity) { /* ... */ }
        public void Submit(string title, string description,
            int severity, int priority) { /* ... */ }
        public void Delete(int id) { /* ... */ }
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am designing a library for my application, that wraps Windows smartcard subsystem. Physically,
I am designing a WPF application that uses a DLL with maybe 40 public
I am currently designing a class library that will provide data to a web
I have created a class library (assembly) that provides messaging, email and sms. This
I'm using this library project in my Android application. But I need to make
I'm writing a class library that provides convenient object-oriented frontends to the C API
I'm designing a thread library. So far I have a method that initializes the
I'm designing a re-usable class library that contains 2 assemblies (amongst others) named core.xml.dll
I'm designing a library that will be used to intercept and process incoming messages
I'm designing a system that will write time series data to a file. The

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.