I have a usecase I dont know how to solve. I have...
# getting-started
e
I have a usecase I dont know how to solve. I have a class
Product
that I do not want to see initialized by itself, but as one of its subclasses
Hardware
or
Software
. The two subclasses has unique values of their own, but the
Product
class has a few shared values that both hardware/software-products will have. However, when I have a
product.software
instance, it does not seem to be able to access the values in the super class. What is the correct model here? Is this solveable by sealed class with nested inner classes?