lundi 22 novembre 2021

Nested MVC and BehaviorSubjects

Let's assume we have an object that is manily a list, List and has its view ListV, and a controller ListC to manage the state.
On the other hand, we have items in that list. Each one has Item model, ItemC to control its state, and ItemV to draw it.

What I am doing is that ListC is inside ListV and that is how we reach the ListM. However, ListV should have ItemV, and the that one should have ItemC where we get ItemM. The question is: Where to we store reference to instances of ItemM?

My problem now:
Let's assume there are 2 instance of ItemM: itemM1 and itemM2; Where do we store those instances? I tried storing them in the instance of ListM, but them even after updating an item using its controller, ListM would still have the old reference.

Aucun commentaire:

Enregistrer un commentaire