You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@reef.apache.org by "Markus Weimer (JIRA)" <ji...@apache.org> on 2015/10/10 10:53:05 UTC

[jira] [Commented] (REEF-827) Standardize Java object field access in InterOp layer

    [ https://issues.apache.org/jira/browse/REEF-827?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14951728#comment-14951728 ] 

Markus Weimer commented on REEF-827:
------------------------------------

+1 on using only {{public}} methods to access fields. Direct access to {{private}} members is very risky, as it messes with IDE (and human) assumptions about what can and cannot be refactored.

Shall we update our coding guide with a section on the bridge and that recommendation as a first step? 

> Standardize Java object field access in InterOp layer
> -----------------------------------------------------
>
>                 Key: REEF-827
>                 URL: https://issues.apache.org/jira/browse/REEF-827
>             Project: REEF
>          Issue Type: Improvement
>          Components: REEF Bridge
>            Reporter: Andrew Chung
>
> Currently, C++ InterOp code can access a field in a Java object either directly (even if it's {{private}}) with {{GetObjectField()}} or through the (often) {{public}} getter method {{GetMethodId}}. Our code uses a combination of both. We should standardize such that it uses either-or, not both.
> Personally, I prefer {{GetMethodId}} as a standard instead of {{GetObjectField}}.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)