Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mobile app: Autofac replaced with TinyIoC #6

Open
davidbritch opened this issue Jan 17, 2018 · 2 comments
Open

Mobile app: Autofac replaced with TinyIoC #6

davidbritch opened this issue Jan 17, 2018 · 2 comments

Comments

@davidbritch
Copy link

davidbritch commented Jan 17, 2018

The eShopOnContainers mobile app, which now uses .NET Standard, has recently received some updates. One of the important updates is that the Autofac IoC container has been replaced by TinyIoC.

Dedicated IoC frameworks, such as Autofac, are feature and capability heavy. However, in a typical mobile application it's unlikely that you'll use most of these features and capabilities. Therefore, swapping to a less heavyweight IoC container should offer some benefits.

TinyIoC is an IoC container that's distributed as a CS file that you add to your project, and offers excellent performance for mobile apps. When comparing TinyIoC to Autofac, type registration is typically 35 times quicker, with type resolution typically being 5 times quicker. This results in the eShopOnContainers mobile app being noticeably more performant on all three platforms, but particularly on Android where the app startup time has been reduced by approximately 2 seconds.

As well as performance, replacing Autofac with TinyIoC has resulted in a number of other advantages:

  • The unit tests run more quickly.
  • The unit tests are more reliable (issues to do with Autofac disposing of objects have been instantly eliminated).
  • There's one less NuGet package distributed with the app, resulting in smaller app package sizes.

This change is just one of many planned for the eShopOnContainers mobile app in the coming months. Check out the latest source in the DEV branch.

@Brosten
Copy link

Brosten commented Jan 17, 2018 via email

@davidbritch
Copy link
Author

Once all the updates are made to the app we'll release a v2 of the eBook, but that'll be a few months away yet.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants