I'm changing a class from public abstract AwesomeClass
, to public sealed AwesomeClass
. I've also added a new property. All existing members are unchanged. I know that this is a breaking change. Clients that have implemented AwesomeClass
or relied on it being abstract via reflection will be broken.
My question is, will clients that have only used members of instances of AwesomeClass
that I've provided, be broken (and if yes how)? None of the clients will have a dependency on any of my types that implemented AwesomeClass
as they were all internal. I think not, but...
Here is the class before and after:
public abstract class AwesomeClass
{
public abstract Guid SuperGuid { get; set; }
public abstract int SuperInt { get; set; }
}
public sealed class AwesomeClass
{
public Guid SuperGuid { get; set; }
public int SuperInt { get; set; }
public int OtherSuperInt { get; set; }
}
You mean that when you have this:
public abstract class Foo
{
public string Bar;
}
void UpdateFooBar(Foo foo)
{
foo.Bar = "Updated";
}
And you change abstract class Foo
to sealed class Foo
, will UpdateFooBar(Foo foo)
continue to work?
What kept you from trying? But yes, it will.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With