Question

I've lately been doing some UI work involving Rx.NET; specifically using ReactiveUI. I really like the declarative way ReactiveUI helps you construct your ViewModel interactions.

However, as most of the logic in ReactiveUI will end up in your constructor, for complex ViewModels it can end up being a bit hard to navigate it all and find the bits you're looking for, as well as do document what different parts are intended to do.

What's your take on these two problems? Moving some observable definitions to private methods? Creating your own extensions methods ('operators')?

Looking forward to hearing some others' views on this!

Was it helpful?

Solution

It's very cool to see people get the "Zen" of how to use RxUI properly, that's awesome!

I typically try to organize the order of my interactions in the order of the user's workflow - i.e. wire up the inputs first, then connect those to the action part of the form (usually via ReactiveCommands), then finally wire up this to the outputs via ToProperty.

I would collapse large queries via Select or SelectMany - I'd avoid defining custom operators unless your operators really do work generally.

Also, if your ViewModels are getting too big, there's still the advice that perhaps it's trying to do too many things and it should be split up, even going so far as to say that the UX itself might be too complex, depending on your audience.

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