Where to put session properties for models with complex relationships


#1

I’m building an ember application that involves a graph. I have node model, node controller, edge model, and edge controller classes.

I store the data that I want to save to my server and persist across sessions as properties on my model objects. But there is other data that I don’t want to persist, and I’m not sure where to put it.

Normally, I’d store that data as properties on my controller objects, but when I try that I run into the following problem: the edge controller needs to access the properties on the node controller and the node controller needs to access the properties on the model controller. I’ve used “needs:” before to help with this kind of situation, but my graph doesn’t have the kind of hierarchical structure that “needs:” needs in order to work.

My current workaround is to store all my properties on the models. Is there a better solution?


#2

Please let me know if you’re perplexed about what to do.