I have an interface that is implemented by thirty specific classes. Concrete performers are divided into two groups: each group is inherited from a common abstract class. Abstract classes are defined by constructors for specific performers, including the transfer in the database connection object for each βsideβ of two sides (they have different databases, among other differences).
All current interface methods have several parameters necessary for specific classes to "complete the task", but not all of them are used in each developer.
When I came to add a new method to the interface this morning, I realized that connecting to the database would be necessary only for one of the specific executors, but otherwise it would not be needed. So, this will interest me, should I pass it as a parameter? This is necessary to "complete the task", but only for one of the specific classes, and this class already has a database connection. If I passed the database connection as an interface parameter, the remaining 29 classes will not use it.
What is a good drawing line for an acceptable interface parameter? Any reading / content on this subject I will also be happy to go.
Steve source share