I am running into the problem of my constructors becoming too large. Please see the example for a Vehicle class below:
- public Vehicle(double width, double length, double turningRadius, double angle, double middleX,
- double middleY, double velocity, double steeringAngle, double velocityMax,
- double velocityChange)
With 10 parts, this is already quite large. I plan to add other aspects to this, such as color, gear shifting, friction, number of tires, etc. My question is, how do I restructure this so that it is more redable and manageable?
I have considered things like combining middleX and middleY into a point, or making a struct for the 3 velocity-related items, or even setting nothing in the constructor and setting each item or group of items with its own function, but that gets messy.
How can I address this issue, when do I know how much is too much, and how can I fix it?