cjlotz / Xamarin.Plugins

Cross platform Xamarin Plugins
MIT License
113 stars 56 forks source link

Optimization: Lazy Load your Messenger Implementation #6

Closed jamesmontemagno closed 9 years ago

jamesmontemagno commented 9 years ago

I would recommend following my "Lazy" loads for each. Else you are creating a new Task each and every time.

cjlotz commented 9 years ago

The task apis' are very cheap to create and they won't be used frequently in app, but I'll consider adding caching and lazy loading in a future update.

cjlotz commented 9 years ago

I've decided to not implement any lazy loading. The different Task implementations carry no state and have no initialization logic in their construction process. All state is passed into the Task when the relevant Messaging API called is made. There is therefore no performance overhead/initialization logic which warrants a technique like lazy loading and I'd therefore prefer not introducing the complexity of managing the state as part of the Messaging API.