Hey *Nic*, Thanks man. Yeah - I'm not talking about anything as radical as all the way into MVVM pattern (and corresponding data-binding requirements).
I'm merely looking at where you have a Model (or hierarchy of models) that contain domain logic. This model may be passed out across many different view/controllers, and if for some reason one part of the model changes (eg. though a user interaction, or some data update) signaling to all concerned controllers via an event. Or more specifically - a "this *Property* just changed" event. Most of the samples I've seen so far around MonoTouch have the models being basically nothing more than simple data objects. Where as I like to encapsulate the generic - non-UI specific, domain logic in these objects. I'm assuming the samples are like this for simplicity sake. But want to check that assumption, and make sure it's not some kind of "way of doing things in iOS". I wouldn't expect that to be the case. Also, C# events feel to me like a far more elegant way of expressing the observer pattern. Doing a sanity check here. Is this crazy to be thinking this way. Am I going against the grain. -- *Phil *Cockfield On Mon, Aug 6, 2012 at 9:52 PM, Nic Wise <[email protected]> wrote: > iOS / Cocoa has the observer pattern baked in, I think. But the only ones > I've seen are mostly MVVM, eg > > https://github.com/RobertKozak/MonoMobile.Views > > http://slodge.blogspot.co.uk/2012/02/mvvmcross-mvvm-across-wp7-monodroid-and.html > > > > On Sun, Aug 5, 2012 at 9:12 PM, Phil Cockfield <[email protected]> wrote: > >> In the past, I've always made a lot of use of property change >> notifications on Models. In .NET I've used the [*INotifyPropertyChanged*] >> interface and associated class from System.ComponentModel. >> >> Before I go blithely diving into adopting this pattern for iOS >> development - is this something other people do? Or in iOS is that >> discouraged. What are common ways for implementing property change >> observation patterns around models in this world. >> >> Thanks! >> -- >> *Phil *Cockfield >> >> >> >> >> _______________________________________________ >> MonoTouch mailing list >> [email protected] >> http://lists.ximian.com/mailman/listinfo/monotouch >> >> > > > -- > Nic Wise > t. +44 7788 592 806 | @fastchicken | http://www.linkedin.com/in/nicwise > b. http://www.fastchicken.co.nz/ > > mobileAgent (for FreeAgent): get your accounts in your pocket. > http://goo.gl/IuBU > Trip Wallet: Keep track of your budget on the go: http://goo.gl/ePhKa > Earnest: Self-employed? Track your business expenses and income. > http://earnestapp.com > Nearest Bus: find when the next bus is coming to your stop. > http://goo.gl/Vcz1p > London Bike App: Find the nearest Boris Bike, and get riding! > http://goo.gl/Icp2 >
_______________________________________________ MonoTouch mailing list [email protected] http://lists.ximian.com/mailman/listinfo/monotouch
