Android Ioc RoboGuice (4) Bindings

Source: Internet
Author: User

The work of Injector is to construct the Object Graph. When you call getInstance to construct an Object of a certain type, Injector will automatically create instances of the required classes based on the dependencies between classes.
The method for defining dependencies between classes is to extend the AbstractAndroidModule and reload its configure method. Define various Bindings in the configure method. These methods also perform type detection. If the type used is incorrect, the compiler will give an error.
Bindings can be bound to the following types:
Linked bindings
Instance bindings
@ Provider methods
Provider bindings
Constructor bindings
Untargetted bindings
Built-in bindings
Just-in-time bindings
Providers, etc.
Later, we will introduce these bindings one by one. These bindings are common and have little relevance with the Android platform. They can be used on both Java EE and Java SE platforms. RoboGuice provides dependency injector related to the Android platform, we will also provide a detailed description later.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.