Should I always specify a class as sealed if it's the last in the inheritance list? As an example, say I've got 3 classes, Foundation
, Building
, and House
.
public class Foundation
{
// Base class
}
public class Building : Foundation
{
// Derived from Foundation
}
public sealed class House : Building
{
// Last in the inheritance tree
}
Is it about safety when I say that I don't want anyone to inherit from House while House itself is inheriting from Building
?