I'm trying to design a class library for a particular engineering application and I'm trying to ensure that my class & namespace naming conventions make sense.
I have the following situation:
namespace Vehicle{ class Wheel{...} //base class for Wheel objects class Engine{...} //base class for Engine objects ... namespace Truck{ class Wheel: Vehicle.Wheel{...} //Truck specific Wheel object class Engine: Vehicle.Engine{...} //Truck specific Engine object ... } namespace Car{ class Wheel: Vehicle.Wheel{...} //Car specific Wheel object class Engine: Vehicle.Engine{...} //Car specific Engine object ... } ... } The code gets used in ways that all of these classes will need to be referenced from within the same scope. The following situation would be likely:
... Vehicle.Wheel.DoSomething(); Vehicle.Truck.Wheel.DoSomething(); Vehicle.Car.Wheel.DoSomething(); ... Under these circumstances, am I better off giving the classes more specific names
namespace Car{ class CarWheel: Vehicle.Wheel{...} //Car specific Wheel object ... } or leave the naming as shown in the first example and rely on the information that is encoded in the namespace for clarity? Under the latter approach, I assume I would want to utilize alaising for clarity in the code that makes use of this library, corret?
It seems redundent to have:
Vehicle.Car.CarWheel or
Vehicle.Truck.TruckEngine but I also want to have very descriptive and specific class names.
Philosophically, what I'm asking is whether or not to include the namespace as a part of the class name when considering if a class name is descriptive enough.