Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    1. COPardon me for the late reply. Thanks for replying. Wouldn't this put two unrelated types in the same inheritance tree? Still, if a method is to return a Person, it would now be returning a PersonResolver, right? So it would have to be casted back to the required type for proper use, right?
      singulars
    2. COThe idea here is, to store only PersonResolver types. A Person can then be resolved to itself (`Person a; a.resolvePerson() == a`), whereas your ResourceLink type would resolve to the person it links (`ResourceLink b; b.resolvePerson() == (Person)b.getTargetOfLink()`). — This allows the use of containers like `List<PersonResolver>` by allowing all of the children to yield a `Person` orthogonally, rather than `if (x instanceof Person)` and the like. As for “inheritance tree,” it's just an interface — it *makes* the types to be related; versus putting two unrelated types into a single container…
      singulars
    3. COso a `Person` would have to have a PersonResolver, which could refer to either a `Person` or `ResourceLink` and we don't care what it is, as it'll be taken care of at runtime. I'm not happy with the *IsA* thing here, as I was looking for something more *HasA* types. But I'm thankful to you for taking time and answering. I'll mark it as accepted as I had, unfortunately, myself thought of an interface, without the resolver thing; but don't want to relate unrelated objects. Thanks!
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload