Irae
Irae
CC#
Created by Irae on 3/21/2023 in #help
❔ Creating a base abstract class to ensure a set of derived classes receive similar dependencies?
Hi, working on creating a class library and I have a set of classes, let's call them PlainPizza, PepperoniPizza and SausagePizza. These three need to have injected into them a set of similar dependencies by the DI container however beyond that they share no common methods. Would it be advisable to have them inherit from a base abstract class that injects those dependencies while each derived class has its own interface that it implements such that unit testing is made easier?
10 replies