3 ms·
Is this really new though? MVVM .NET apps similarly use getters & setters in this manner, except with XAML.
by ducharmdev 5y ago
Is this really new though? MVVM .NET apps similarly use getters & setters in this manner, except with XAML.
- couchand 5y agoI've never seen .NET code that has magic properties hiding expensive operations, though my .NET experience is admittedly limited. Is that idiomatic?
- ducharmdev 5y agoMaybe so; it's pretty normal to expect a property setter to perform additional operations, as it's necessary for making data binding more manageable among other things. But using Go to Definition takes me directly to the getter/setter, so imo it's not exactly hidden. I think it becomes problematic (or more magical) when these network/database/expensive calls are made willy nilly throughout an application, without a dedicated class or layer to aggregate these kinds of operations. If you have things architected correctly, it's not a big deal to trace these kinds of things throughout your app.