Classes relation design
I'm designing a class on an object and I have another class that has more
characteristics and detail about the class in terms of something like
class Car and CarCharacteristicsRoad for this class's specific
characteristics/functions on the road for instance. The car class has like
10-20 functions and CarCharacteristicsRoad has like 10 more functions
specific to this class on the road. I broke up the classes into two
classes so I can manage this class.
So whenever CarCharacteristicsRoad is talked about, there should be a Car.
Should I use inherited class, sub class or any relation that I can
restrict CarCharacteristicsRoad to Car object? Is there any restriction
mechanism that I should use in C# so that it is more intuitive to assume
that carcharateristicsroad is relative to car so that
CarCharacteristicsRoad doesn't get thrown about in many different places
like it is a higher level class (real object)
How would you design this?
No comments:
Post a Comment