-1

I am working in a wizard in WPF application. As the wizard gathers a lot of information I have designed separate view models for each step (view) in a wizard. But I have to hold all this information in an object to display in a summary screen and push to database when the user reviews the summary and submits.

Example: Say there is a vehicle registration wizard.

class VehicleDetails
   {
     string Name {get;set;}
     int Number {get;set;}
   }

class VehicleOwner
{
  string Name {get;set;}
  string Address {get;set;}
}

Class VehicleFeatures
{
  string Color {get;set;}
  int EngineCapacity {get;set;}
} 

Now as the user fills all this information step by step I have to hold the information in a seperate instance to summarize and submit.

Class Vehicle________ (Master/Container/?)
{
  VehicleDetails Details {get;set;}
  VehicleOwner Owner {get;set;}
  VehicleFeatures Features {get;set;}
}

What is the best way I could name so that the furute 'Reader' of this code could understand my intent ? Is there any standard vocabulary for such scenario ?

  • 4
    What about Vehicle? – Ben Aaronson Nov 21 '16 at 11:44
  • 1
    How about Vehicle? – Mr Cochese Nov 21 '16 at 11:50
  • 1
    Do you really need separate class for each of those? – Euphoric Nov 21 '16 at 11:50
  • The name of the class is Vehicle. – Tulains Córdova Nov 21 '16 at 12:19
2

In layman's terms:

  • Nobody said class members had to be primitives.
  • Class members can be of any type, including user-defined types.
  • The fact that some members of the class Vehicle are user-defined doesn't make Vehicle into a VehicleContainer or a VehicleMaster
  • A vehicle container would be a class that containts vehicles, which in this case it is not
  • VehicleMaster would be... I don't know what that would be.

Bottom line: the name of the class should be Vehicle.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.