base class or object type property
I have designer dilemma. I make a program in C# (wpf) and want to use MVVM. I have a viewmodel that contains a model. This model say a vehicle, exists in different types which do the same thing in different ways (truck, jeep, tractor, car) I can make a base class viewmodel and derive all viewmodel from the baseclass (this is quitte a lot of work and requires 4 viewmodels and 4 views to be made, and of course the base class) VehicleViewModel // base class TruckViewModel : VehicleViewModel JeepViewModel : VehicleViewModel TractorViewModel : VehicleViewModel CarViewModel : VehicleViewModel or I can use just one viewmodel and define the type of model that is used as a constructor parameter. This is less work. VehicleViewModel(VehicleType MyVehicle) Which way do you prefer ? Why should I choosse the first or the second option