Skip to content

naming: delete vs release #707

Closed
dart-archive/jnigen
#379
@dcharkes

Description

@dcharkes

We have delete, deleteIn and in dart-archive/jnigen#130 deleteOriginal.

"delete" refers to deleting the handle that holds on to the Java object (DeleteGlobalRef).

However, the method is on an object representing a Java object. And we're not actually deleting any Java objects. Instead, we're letting go of the Java object.

Someone using our API does not know about handles, they just know that we are "referring" to a Java object (JReference).

So, we should consider renaming "delete" to something that signals we're no longer holding on, no longer referring to the Java object. For example "release". You release the object, the opposite of holding on. (Or maybe the opposite of holding on would be "let go" but that is two words.) Or another option is we "forget" about the Java object, but that seems like we're in control of what we're doing. So, "release"?

Some prior discussion: #766

@mahesh-hegde I want to move more and more away from the JNI implementation details. 🙃
@HosseinYousefi what are your thoughts about this?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    Status

    Done

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions