Page MenuHomePhabricator

[MVVM] Factory text property handles
Closed, ResolvedPublic


[Discussion Session]

in the factory with model,
text property will be delivered by property get with future.
If the value of model property is updated later on, normal text_set cannot tracing this changes.

so this task is discussion about how to give easy handler of text property of model in factory with linking the text to model property.

I'm thinking we should probably change Model interface. Instead of using "properties,changed" event, we should have a property_get which returns a Observable_Value. This value would have an event for when its value changes, but we could, too, set this Observable_Value to parts. This way, parts could refresh the changes whenever the Observable_Value changes too.

We would remove futures completely from Model.

What do you think of this solution?

SanghyeonLee added a comment.EditedOct 24 2018, 10:13 PM

I have to see the sample code about what you talk but, yes, I agree that we need some other interface for getting property values rather than events.

but we do not have much time for this, so it must be inplemented as quick as we can.
please give us more detail of this proposal.

cedric added a subscriber: cedric.Nov 16 2018, 11:04 AM

There is no future to get property. You need to watch for an event if you want to manually get notified of value being changed, but you can always get a property synchronously by doing a property.get. In general, most user should not have to care about that as they just need to do an .connect and things would be taken care of for them by the widget.

I am repeating my concern here about observable, but if every property is now to be connected via an object, it will end up with a massive memory price.

SanghyeonLee closed this task as Resolved.Wed, Dec 26, 3:34 AM

I think we discuss about it in T5365,
so this task is no more necessary.
I'll close the task.