Created
March 23, 2012 17:04
-
-
Save kumpera/2172800 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| What makes a bridge object? | |
| A bridge object is a bridge class with a non-null handle. | |
| What makes a bridge class? | |
| A bridge class must respect the follow rules: | |
| -Be a subclass of Java.Lang.Object; and | |
| -The Java side has a monodroidAddReference method. | |
| In which cases a bridge class can be ignored as been one? | |
| -It only have value type (eg int) fields; or | |
| -It doesn't have a non-mirrored field that could transitively point to another bridge object. | |
| A mirrored field is a field that exists both in C# and Java and is kept in sync between the two. | |
| Actually, I don't know for sure if we have those. | |
| The transitively points to another bridge object means that another bridge object can be reached | |
| directly or indirectly through that field. Eg, System.Object and Java.Lang.Object do, System.String | |
| doesn't. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
"Subclass of
Java.Lang.Object" and "hasmonodroidAddReferencemethod" means "has an Android Callable Wrapper" (ACW): http://docs.xamarin.com/android/advanced_topics/architecture/android_callable_wrappersFor the most part, ACWs are stupid. No field mirroring is performed, no checking of class fields is performed. All the ACW generation mechanism cares about is constructors and methods. This will be changing to partially include fields, via
[ExportField]. However,[ExportFielddoes not keep the Java & C# fields in sync; it's an init-only mechanism, in which the Java field is initialized with a C# value. If the C# value changes, the Java value will not.Thus, in the absence of
[ExportField], there will be no bridge classes which have non-mirrored fields. With[ExportField], I believe there still won't be any such classes, as the fields aren't kept in sync.