You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We need consistent naming, which brings us to the current naming
dictionary:
https://developer.xamarin.com/guides/android/advanced_topics/garbage_collection/#Cross-VM_Object_Collections
Changing certain names to be consistent with Java.Interop, we have:
> There are three categories of object types.
>
> * **Managed objects**: types which do not inherit from `JavaObject`,
> e.g. `System.String`. These are collected normally by the GC.
>
> * **Java objects**: Java types which are present within the [Java] VM
> but not exposed to the Mono VM.
>
> * **Peer objects**: types which implement `IJavaPeerable`, e.g. all
> `JavaObject` and `JavaException` subclasses. Instances of these
> types have two "halfs" a *managed peer* and a *native peer*.
> The managed peer is an instance of the managed type.
> The native peer is an instance of a Java class within the Java VM,
> and the managed `IJavaPeerable.PeerReference` property contains a
> JNI global reference to the native peer.
>
> There are two types of native peers:
>
> * **Framework peers**: "Normal" Java types which know nothing of
> Java.Interop, e.g. java.lang.String.
> * **User peers**: Java Callable Wrappers which exist for each
> `JavaObject` subclass present within the app.
Notice a word "missing" from that terminology description? "Wrapper".
The problem with "wrapper" is that it implies something is being
"wrapped", which *is not the case* with User Peers; the "wrapper"
would be the corresponding Java instance, the *User peer*, but it's
not a wrapper, so using "Wrapper" is misleading.
Instead, Xamarin.Android uses the term "Peer" ~fairly consistently,
and Java.Interop has been following suite in some areas, e.g.
IJava**Peer**able.**Peer**Reference. ;-)
Replace all instances of "Wrapper" within Java.Interop.dll and replace
with "Peer":
* JniRuntime.JniValueManager.CreateWrapper() is now
JniRuntime.JniValueManager.CreatePeer().
* JniTypeSignature.GetPrimitiveWrapper() is now
JniTypeSignature.GetPrimitivePeerTypeSignature().
* JniTypeSignatureAttribute.GenerateJavaWrapper is now
JniTypeSignatureAttribute.GenerateJavaPeer.
0 commit comments