Make a New Parameter
This can often be solved by using a class or struct to use as single parameter rather than the built-in Types.
The Interface
You know what to expect from a class when it implements a familiar interface. We know that all classes implementing the IEnumerable interface can be used in a foreach loop. By convention, the name of the interface is "I" followed by a description of an ability. It is typical for the name to end with the suffix "-able".
-able
Suffix forming adjectives meaning:
1 -able to be [as in] calculable.
2 -having the quality of [as in] comfortable.
Oxford English Dictionary
Let's rename parentInterface and MethodA() to give a clear example of how this normally works (and to avoid negative sanctions):
public interface ITreatable
{
Treatment GetTreatment();
}
Well, finding the cure may not be so easy, even if the object represents a treatable illness. Here's some examples:
public class TheFlu : ITreatable
{
public Treatment GetTreatment(int year)
{
// return some object, Treatment, based on the flu season.
}
}
public class Hangover : ITreatable
{
public Treatment GetTreatment()
{
return Treatment.Empty; // no parameters necessary.
}
}
public class Insomnia : ITreatable
{
public Treatment GetTreatment(FamilyHistory occurances, LabResult lab)
{
// return Some Treatment object that can be different based on the
// calculated risk from the arguments.
}
}
What We're Really Missing Here
I don't know biology, but the concept is still the same. You have a group of ITreatable illness objects that need to have a GetTreatment() method; however, they use different criteria for making calculations. We need Symptoms.
public class Symptoms
{
public FamilyHistory History;
public DateTime Time;
public LabResult Lab;
public BloodTest BloodTest;
public TimeSpan SymptomTime;
public IsCritical IsCritical;
}
Now, the objects can parse the symptoms in their own method, and our interface will look like this:
public interface ITreatable
{
Treatment GetTreatment(Symptoms symptoms);
}
childB's the implementation wherechildAcalls its version from method a with a default value fordbut then without knowledge of what methodA actually does, its impossible to tell if this is actually a good idea (i'd imagine it isn't)