Closed Shakezulla57 closed 6 years ago
I would keep the whole tag
instance inside the state, that doesn't sound like a problem to me.
Thanks for getting back to me. So would the current state be stored in the view then as a member? When the user hits a save button for example we get everything we need to pass to our domain layer from that current state member variable?
Yeah there is definitely the need to store this variable somewhere, the hardest thing is to make it, kind of read only and always in sync with the lastest state so we keep a unique source of truth.
I'm looking for opinions on where to store model state that can't be extracted from the View. Keeping with the tasks example let's add a
Tag
object to a task. ATag
consists of anId
and aLabel
. The ViewState only cares about theLabel
so it can display it, so theId
isn't part of the state. Whose job should it be to actually update theTask
object with the correctTagId
until we hit save? The action processor, the viewmodel? Would updating our in memoryTask
just be a side effect of intents, or could we store things in our ViewState that don't necessarily display directly but are need for when the user hits save? That seems messy though because you'd have to store the current state outside of the stream.