You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@jackrabbit.apache.org by "Jukka Zitting (JIRA)" <ji...@apache.org> on 2009/07/11 21:37:14 UTC

[jira] Created: (JCR-2206) Replace NodeReferencesId with NodeId

Replace NodeReferencesId with NodeId
------------------------------------

                 Key: JCR-2206
                 URL: https://issues.apache.org/jira/browse/JCR-2206
             Project: Jackrabbit Content Repository
          Issue Type: Improvement
          Components: jackrabbit-core
            Reporter: Jukka Zitting
            Assignee: Jukka Zitting
            Priority: Minor


The NodeReferencesId class simply wraps a NodeId and forwards all essential method calls to it.

The main (only?) benefit of having NodeReferencesId as a separate class is the ability to distinguish between the overloaded exists() and load() method signatures on PersistenceManager. The downside is the need to instantiate all the NodeReferencesId wrapper objects whenever accessing the references to a node.

I propose to rename the overloaded methods to hasReferencesTo(NodeId) and getReferencesTo(NodeId) and to replace the NodeReferencesId with just the target NodeId wherever used.


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Updated: (JCR-2206) Replace NodeReferencesId with NodeId

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting updated JCR-2206:
-------------------------------

    Attachment: NodeReferencesId.patch

Attached a proposed patch.

The patch is pretty big, as it's the result of about a dozen refactoring steps required to replace all references to NodeReferencesId. None of the steps introduced any functional changes, so also the aggregate is pretty safe.

> Replace NodeReferencesId with NodeId
> ------------------------------------
>
>                 Key: JCR-2206
>                 URL: https://issues.apache.org/jira/browse/JCR-2206
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Jukka Zitting
>            Assignee: Jukka Zitting
>            Priority: Minor
>         Attachments: NodeReferencesId.patch
>
>
> The NodeReferencesId class simply wraps a NodeId and forwards all essential method calls to it.
> The main (only?) benefit of having NodeReferencesId as a separate class is the ability to distinguish between the overloaded exists() and load() method signatures on PersistenceManager. The downside is the need to instantiate all the NodeReferencesId wrapper objects whenever accessing the references to a node.
> I propose to rename the overloaded methods to hasReferencesTo(NodeId) and getReferencesTo(NodeId) and to replace the NodeReferencesId with just the target NodeId wherever used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2206) Replace NodeReferencesId with NodeId

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12730020#action_12730020 ] 

Jukka Zitting commented on JCR-2206:
------------------------------------

Agreed, good point.

> Replace NodeReferencesId with NodeId
> ------------------------------------
>
>                 Key: JCR-2206
>                 URL: https://issues.apache.org/jira/browse/JCR-2206
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Jukka Zitting
>            Assignee: Jukka Zitting
>            Priority: Minor
>         Attachments: NodeReferencesId.patch
>
>
> The NodeReferencesId class simply wraps a NodeId and forwards all essential method calls to it.
> The main (only?) benefit of having NodeReferencesId as a separate class is the ability to distinguish between the overloaded exists() and load() method signatures on PersistenceManager. The downside is the need to instantiate all the NodeReferencesId wrapper objects whenever accessing the references to a node.
> I propose to rename the overloaded methods to hasReferencesTo(NodeId) and getReferencesTo(NodeId) and to replace the NodeReferencesId with just the target NodeId wherever used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Resolved: (JCR-2206) Replace NodeReferencesId with NodeId

Posted by "Jukka Zitting (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/JCR-2206?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Jukka Zitting resolved JCR-2206.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 2.0.0

OK, I committed the patch with the updated method names in revision 793243.

> Replace NodeReferencesId with NodeId
> ------------------------------------
>
>                 Key: JCR-2206
>                 URL: https://issues.apache.org/jira/browse/JCR-2206
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Jukka Zitting
>            Assignee: Jukka Zitting
>            Priority: Minor
>             Fix For: 2.0.0
>
>         Attachments: NodeReferencesId.patch
>
>
> The NodeReferencesId class simply wraps a NodeId and forwards all essential method calls to it.
> The main (only?) benefit of having NodeReferencesId as a separate class is the ability to distinguish between the overloaded exists() and load() method signatures on PersistenceManager. The downside is the need to instantiate all the NodeReferencesId wrapper objects whenever accessing the references to a node.
> I propose to rename the overloaded methods to hasReferencesTo(NodeId) and getReferencesTo(NodeId) and to replace the NodeReferencesId with just the target NodeId wherever used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


[jira] Commented: (JCR-2206) Replace NodeReferencesId with NodeId

Posted by "Tobias Bocanegra (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/JCR-2206?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12730019#action_12730019 ] 

Tobias Bocanegra commented on JCR-2206:
---------------------------------------

in general +1

but i would keep the method names similar to avoid confusion:

  NodeReferences loadReferencesTo(NodeId id)
  boolean existReferencesTo(NodeId targetId)



> Replace NodeReferencesId with NodeId
> ------------------------------------
>
>                 Key: JCR-2206
>                 URL: https://issues.apache.org/jira/browse/JCR-2206
>             Project: Jackrabbit Content Repository
>          Issue Type: Improvement
>          Components: jackrabbit-core
>            Reporter: Jukka Zitting
>            Assignee: Jukka Zitting
>            Priority: Minor
>         Attachments: NodeReferencesId.patch
>
>
> The NodeReferencesId class simply wraps a NodeId and forwards all essential method calls to it.
> The main (only?) benefit of having NodeReferencesId as a separate class is the ability to distinguish between the overloaded exists() and load() method signatures on PersistenceManager. The downside is the need to instantiate all the NodeReferencesId wrapper objects whenever accessing the references to a node.
> I propose to rename the overloaded methods to hasReferencesTo(NodeId) and getReferencesTo(NodeId) and to replace the NodeReferencesId with just the target NodeId wherever used.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.