Updownquark / Quick

Quark's User Interface Creation Kit
0 stars 0 forks source link

Integrate MUIS Models into AttributeManager #47

Closed Updownquark closed 10 years ago

Updownquark commented 10 years ago

I've been thinking more about the model backend to MUIS and I feel strongly that everything about an element should be controllable by models which should be completely ignorant about the widget itself and perhaps even about the MUIS framework as a whole. If this is implemented correctly, it should be possible to completely refactor or rewrite a MUIS front end to an application without changing the application or model code at all.

In order to accomplish this, I think the AttributeManager should become aware of models. AttributeManager should scan all attribute values for a standard-formatted expression denoting a model value. The manager would parse that piece of the attribute value and watch that model value for changes, issuing attribute changed events when the value changes.

Ideally, PropertyTypes that parse attributes would not need to be aware of models at all, but I'm not sure this is reasonable. To accomplish this, the attribute manager would replace the model value expression by the serialized value itself. However, serializing the model's value in the particular way that the PropertyType would understand is sticky when the model value makes up only part of the attribute, especially when the parser may delegate to other parsers, as in styles. If a way can be found to do this elegantly, great; but it may be acceptable to expose a method by which the individual parsers can ask the attribute manager or some other entity to detect, parse, and evaluate model value expressions.

Updownquark commented 10 years ago

Well that was easy. I did end up going the "acceptable" way instead of the ideal way. Couldn't see how to do otherwise elegantly. I'm closing this now since implementation is done, though I may tag this issue if there are fixes to the functionality.