ekolis / FrEee

An open source clone of the classic 4X game Space Empires IV.
http://edkolis.com/freee
48 stars 12 forks source link

Add view models to all forms and controls #292

Open ekolis opened 7 months ago

ekolis commented 7 months ago

What needs to be cleaned up? We need to add view models to all of our forms and controls in the UI. And get rid of any properties on the existing model that needed to be moved to the view model, unless the backend also needs them.

How will this benefit us?

Separating UI-related model code from backend data storage related model code will make the game more maintainable. We already have duplicate properties on objects for the "real" property and the "reference" property. Might as well split those into a view model and a data model; that's a perfect way to break them up without breaking serialization.

What potential drawbacks are there to making this change?

Time wasted, duplicate code

Notes This is part of #287.

ekolis commented 7 months ago

Oh, wait a second, what if we need the real property from inside the model too, for accessing related data? Do we need a data model, a model, and a view model?

ekolis commented 3 months ago

Oh, wait a second, what if we need the real property from inside the model too, for accessing related data? Do we need a data model, a model, and a view model?

yes we do, see #312