The current code looks like this:
public class Details
{
Public void Populate()
{
WriteChapterDetails();
}
public void WriteChapterDetails()
{
if ( includeHighDetails)
{
\\Do something
}
if (includeLowDetails)
{
\\Do something
}
}
}
I now want to write a new class named HighDetails which will be copy of the Details class except I don't want it to go to the if (includeLowDetails)
condition.
I am thinking of deriving a class from Details class like:
public class HighDetails()
{
Public void Populate()
{
WriteChapterDetails();
}
public void WriteChapterDetails()
{
if ( includeHighDetails)
{
\\Do something
}
}
The Details class is a huge class and I don't want to repeat all the methods in the HighDetails class. I want to derive from the Details class and somehow not include the LowDetails. How can I do that?
HighDetails
is little more than aDetails
class withincludeHighDetails
set totrue
andincludeLowDetails
set tofalse
.