79576453

Date: 2025-04-16 05:37:38
Score: 1
Natty:
Report link

What we do is make our data model pure but make a new view class based on that with things like Ishighlighted. Eg

Class Entity

Class EntityView : Entity

{

Public bool isHighlighted;

}

Or alternatively

Class EntityView

{
 Public Entity entity

  Public bool isHighlighted;

}

That way you can connect EntityView to the UI and keep the data object Entity "pure". Crud and other operations can simply use the underlying Entity by reference EntityView.Entity.
Reasons:
  • Has code block (-0.5):
  • Starts with a question (0.5): What we
  • Low reputation (1):
Posted by: Geoff Davison