InseeFr / InseeFr/Eno

How to manage instanciation of out model when there is polymorphism

Open
#512 0 comments 0 reactions 2 assignees Claimed by @nsenave View on GitHub
implementation discussion
Dominant language
Java
Stars
17
Forks
26
PR merge metrics
No merged PRs in 30d

Description

We do not control output models (for example lunatic-model) and sometimes they use polymorphism (for example `Questionnaire.getComponents()` is of type ComponentType which has many children). So when we instanciate an element for collections with this kind of types in out models, we must find a solution via annotations (not to break the mapping logical) to specify wich children instanciate (for example, when we instanciate an element to populate `Questionnaire.getComponents()`, we must find which implementation of `ComponentType`to use.

two solutions :
1. We should add annotation over eno model types to specify to which concrete out (also in ?) type they are mapped
2. we should add an attribute to the mappings annotations (for example @Lunatic) to specify to which concrete type a eno model element should be mapped at runtime. this attribute can be not mandatory.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.