Replies: 2 comments 2 replies
-
This is worth addressing. I think there is at least one other aspect worth considering. Firstly, it might be worth looking at why Matthew West (author of HQDM) made use of it. As @jamrce alluded already, the EXPRESS keyword This description of the issue points at an additional consideration to resolve the problem Suggestion 3Introduce two subtypes of Impacts to Magma Core
Suggestion 4Implement both Suggestions 2 & 3 (with harmonised naming). The EXPRESS would then become the following:
Impacts to Magma CoreRoughly a combination to suggestions 2 & 3. Suggestion 5There is a quick way to side-step the introduction of new intermediate types and still get rid of the SELECT type. Allow the The EXPRESS would then become the following:
This may not be legit EXPRESS but I don't think we are trying to formally adhere to the standard. It's a quick fix but may be unsatisfactory in the long-term. Impacts to Magma CoreMinimal. Backwards compatibility would be retained as-is. My preference is to combine Suggestions 2 & 3 (i.e. Suggestion 4). If not that, then Suggestion 5. Suggestion 1 is a structural change to what these entity types in HQDM are.
|
Beta Was this translation helpful? Give feedback.
-
Something to consider is that the SELECT represents a 'sum' type, and there are programming languages that support such types, for example: TypeScript, Haskell, and Rust, and probably others (including EXPRESS of course), but unfortunately Java doesn't support sum types yet and may never support them. Since it's a Java problem I'd suggest that changing the EXPRESS is not necessary, but the Java implementation would need superclass/subclasses along the lines of suggestion 2, and languages that support sum types properly can have an implementation that match the SELECT more closely, e.g. in TypeScript: interface Activity {}
interface Association {}
interface Participant {
participant_in? : Activity | Association;
} |
Beta Was this translation helpful? Give feedback.
-
Problem
The participant_in_activity_or_association SELECT is a key pattern in the model, however the use of a SELECT can cause issues with implementations of it when trying to participate in either an activity or an association.
Problem statement: Is there a different way of creating this pattern in the model to negate the need for a SELECT?
Context
HQDM is quite keen to have two separate entities for handling participation and chiefly as stated on page 135 they have some key differences.
This pattern (association) is very similar to the pattern for activity; states of individuals play roles in the association, just as they do with the activity. There are two important differences:
With final definitions being provided as:
Association - An individual that consists_of the participants that are associated, and where the participants are part_of the same period_of_time.
Activity - An individual that consists of its participants and causes some event.
Suggestion 1
Relax the identity of "association" to not enforce all participates are there for the full duration of the period of time to enable "activity" now be a SUBTYPE of "association". Associations that expect that full duration could be handled through a class / kind of association.
Key points:
The EXPRESS would then become the following:
Suggestion 2
Introduce a new entity as an "abstract" super-type for the participation for either extension named "engagement" for the sake of an initial idea.
Key points:
The EXPRESS would then become:
Final thoughts
Both of these approaches should ease software implementations and provide a useful mechanism to better articulate the pattern that was originally being described. Whilst submitted by myself, this was the output of an internal discussion. Happy to provide further discussion or block diagrams to aid understanding of what the implications would be.
Beta Was this translation helpful? Give feedback.
All reactions