You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@commonsrdf.apache.org by afs <gi...@git.apache.org> on 2016/06/02 11:22:51 UTC

[GitHub] incubator-commonsrdf pull request #:

Github user afs commented on the pull request:

    https://github.com/apache/incubator-commonsrdf/commit/bc639bbd3b65ed6802dfdac14a53c9f96162bf32#commitcomment-17712158
  
    In api/src/main/java/org/apache/commons/rdf/api/QuadLike.java:
    In api/src/main/java/org/apache/commons/rdf/api/QuadLike.java on line 40:
    I appreciate the attempt to support generalized RDF.
    
    How do these interfaces avoid the problems of `Quad extends Triple`?
    
    This is a general Java issue - value-based equality breaks when adding a field (so being in a set breaks).
    
    If a class adds a field, then value-based equality can not be made to work. Two "equals" objects, here `TripleLike<S,P,O>`, can have different G field for `QuadLike<S,P,O,G>`.
    
    Adding an operation to an interface which is modelling a new field does not change the situation. Should the value of the `getGraphName` method influence the outcome of `.equals`?  If viewed as a `TripleLike` then "no", if as a QuadLike, then "yes". But a quad is both.
    
    http://www.javapractices.com/topic/TopicAction.do?Id=17


---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at infrastructure@apache.org or file a JIRA ticket
with INFRA.
---