As an example, say I have a single domain object with 100 properties. In my UI I need complex validation of the style:
You can see my problem here. The relationships between the properties are hideously complex, with validation changing dependant on earlier values and in combination with other values.
How have people modelled and handled this in the past? Validation does not need to very often, but a config/xml-based solution would probably be best.
You could project this gigantic domain object into smaller objects containing only the subsets of properties needed and name them according to the scenario they are describing. It's creating some sort of ViewModel if you will.
There has to be a specific use case for each case of A = "X" or B = "Y" etc. If you are splitting things up you can define validation rules per ViewModel. Those ViewModels could also contain the visible/hidden settings for your controls.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With