Dan Haywood created ISIS-814:
--------------------------------
Summary: Provide a better way to handle polymorphic relationships,
eg implement a "PolymorphicNavigator service"
Key: ISIS-814
URL: https://issues.apache.org/jira/browse/ISIS-814
Project: Isis
Issue Type: New Feature
Components: Core
Affects Versions: core-1.5.0
Reporter: Dan Haywood
Assignee: Dan Haywood
Priority: Minor
Fix For: core-1.6.0
We'd like to be able to decouple modules (eg from Estatio or wherever) and make
them reusable for others.
For example, Estatio has "CommunicationChannel", where its owner is of type
CommunicationChannelOwner. We currently use DataNucleus' support for interface
mappings, but (because we use annotations) this requires us to list the fully
qualified class names of the implementations in the CommunicationChannel;
hardly reusable code.
Naked Objects MVC has a service called the PolymorphicNavigator [1], a
mechanism to handle relationships between different Entity Framework contexts,
typically via an interface.
The PolymorphicNavigator requires that all implementations use an int (or long)
as their primary key. It then stores the relationship in a separate table,
qualified by the object type. This is a bit like DataNucleus' "identity"
strategy for mapping interfaces [2], except that:
- two columns are used, not one (for object type, and object PK
- the link is held separately from the rest of the object's data.
[1]
https://github.com/NakedObjectsGroup/NakedObjectsFramework/blob/4e860789ad115a38cd3348ceb5c0b141fb0e0d7b/Programming%20Model/NakedObjects.Helpers/Services/PolymorphicNavigator.cs
[2] http://www.datanucleus.org/products/datanucleus/jdo/orm/interfaces.html
--
This message was sent by Atlassian JIRA
(v6.2#6252)