Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Generator: Implement Composition as abstract class to inherit redundant fields for other Compositions #94

Closed
7 tasks
SevKohler opened this issue Oct 1, 2020 · 5 comments · Fixed by #153
Labels
enhancement New feature or request

Comments

@SevKohler
Copy link
Contributor

SevKohler commented Oct 1, 2020

Background

Currently many of the generated Compositions contain duplicated fields like Language, these Attributes could be contained by a root class Composition, which makes specific Compositions smaller and allows easier handling of Compositions when programming. Especially when in general Compositions are to be referenced.

Acceptance criteria

Implement (abstract) class Composition that contains all Attributes that are standard to every Composition.

Success criteria

  • Review / Merge request approved (P2P session)
  • Unit tests passed
  • Updated documentation (Javadoc and Sphinx)
  • Acceptance criteria fulfilled
  • Build without errors
  • Release notes prepared
  • Runtime warnings
@SevKohler SevKohler added the enhancement New feature or request label Oct 1, 2020
@SevKohler SevKohler changed the title Implemet Composition as abstract class to inherit redundant fields for other Compositions Generator: Implemet Composition as abstract class to inherit redundant fields for other Compositions Oct 1, 2020
@ppazos ppazos changed the title Generator: Implemet Composition as abstract class to inherit redundant fields for other Compositions Generator: Implement Composition as abstract class to inherit redundant fields for other Compositions Nov 3, 2020
@ppazos
Copy link

ppazos commented Nov 13, 2020

I think we can have an AbstractComposition in the shared package that all generated Composition DTOs inherit from.

@subigre
Copy link

subigre commented Nov 16, 2020

+1 I would appreciate if we might have this abstract Composition class.
This could help to implement the FHIR Bridge and the openEHR components for Camel having something similar to the MessageConverter provided by Spring for JMS.

@subigre
Copy link

subigre commented Nov 17, 2020

One additional comment, it might be interesting to update the CompositionEndpoint:

public interface CompositionEndpoint {

    <T extends Composition> T mergeCompositionEntity(T entity);

    <T extends Composition> Optional<T> find(UUID compositionId, Class<T> clazz);
}

@SevKohler
Copy link
Contributor Author

SevKohler commented Nov 19, 2020

This depends on the Composition, if we have fields that are contained in every Composition, because of the Reference Model, it is better to use an Abstract Class (if not we have to duplicate them). If not i agree on the solution above.

@stefanspiska
Copy link
Contributor

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

Successfully merging a pull request may close this issue.

4 participants