locked
Product Customization + Inheritance RRS feed

  • Question

  • User1733326705 posted

    We have a product with few customers. Customers have different implementations for same methods.

    We thougt to use inheritance and we are not going to change the original implementation of the product.


    for an example: OrderService (class)

    OrderServiceCompany

    OrderServiceClient1 : OrderServiceCompany

    OrderServiceClient2 : OrderServiceCompany


    We are maintaing different branches for different clients (as the example 2 branches). But the implementation of OrderServiceCompany would be same for both clients. If there is any deviation they have to use OrderServiceClient class.

    If there is any method which we do not allow any modification to client, we can make it sealed.


    Do you think, this is a wise model or any drawback with this design???





    Saturday, May 15, 2010 11:54 AM

Answers

  • User-952121411 posted

    Customers have different implementations for same methods.
     

    What about creating an Interface for OrderServiceCompany and implement the methods as needed for each client as needed?  If you have a finite number of customers each with your own customized implementation then that should work.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 17, 2010 4:23 PM

All replies

  • User-863835478 posted

    Please go ahead do it, test and find out.

    Saturday, May 15, 2010 4:56 PM
  • User-952121411 posted

    Customers have different implementations for same methods.
     

    What about creating an Interface for OrderServiceCompany and implement the methods as needed for each client as needed?  If you have a finite number of customers each with your own customized implementation then that should work.

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Monday, May 17, 2010 4:23 PM