Question

My app has windows that are components. In my case, now I have 2 components that have a drop down list that show the current logged user lists. So when I use one component for the first time it make a request to database, save data in model, and load data from model, but when the second component opens, it will just load data from model. Easy for now: ListModel: this contains the current user lists.

Now I have another component but this needs the lists of another user. Where do I save these lists? I can't put in the ListModel as then will mix up with current user.

Just a remind: there is not just 2 users. It might have more users, so it should be scalable.

Then another problem that will solve both: Each list has items. They will be saved in ListItemModel? How to make to not mix between lists. So items from ListX doens't mix up with items from ListY?

thanks

Was it helpful?

Solution

Don't be timid with the models. Use as many as you need to model your data for effective use. You can model the same data in several different ways. If you find commonality between models, extract a base class for them to use

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top