So, I've been asked to turn 2 classes that inherit the same interface into one.
SimpleData class would be provided with implementations of IHelper and IDataHelper interfaces in the constructor.
Let's take IDataHelper
.
There is a function definition that reads bool HasWarnedUser()
.
I had 2 separate classes of SimpleData
. One in a .NET Standard project library, and one in a .NET Framework library.
SimpleData
in the .NET Standard library implements the HasWarnedUser
function inheriting from IDataHelper
with a throw new Unimplemented()
exception, i.e.
public bool HasWarnedUser()
{
throw new NotImplementedException("Please provide implementation for this function call");
}
The SimpleData
in the .NET Framework library implements it like so:
public bool HasWarnedUser()
{
MessageBox.Show("SomeMessage", "SomeCaption");
return true;
}
This is just a basic example (ignore the code per say - it's not doing anything smart or anything that would make proper sense).
I've been told to just have one SimpleData
class that would be provided with implementations of IHelper
in the constructor.
What does this mean?
When declaring a new SimpleData
object, how would we determine what is placed into the constructor?
If anyone understands, I'd appreciate an explanation :).
Thanks!