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

[Feature] Copy constructor in base classes #85

Open
arnoweiss opened this issue Apr 2, 2023 · 3 comments
Open

[Feature] Copy constructor in base classes #85

arnoweiss opened this issue Apr 2, 2023 · 3 comments
Assignees
Labels
3.0 Final AAS V3 Final Release enhancement New feature or request V.1.1.0 Final Release V.1.1.0 incl. additional features

Comments

@arnoweiss
Copy link
Contributor

Currently, there's no proper way to copy a meta-model-instance. The classes don't implement Cloneable or offer a copy constructor. Especially when creating multiple instances of an object (like multiple Properties in a SubmodelElementList) from a template (single Property in a SubmodelElementList) this would come in quite handy.

@FrankSchnicke
Copy link
Contributor

@sebbader-sap : Is there any chance to include a copy constructor in the model generator for the 1.0.0 release?

@twebermartins twebermartins added 3.0 Final AAS V3 Final Release V.1.0.0 Final Release V.1.0.0 following EF processes labels Jun 5, 2023
@sebbader-sap sebbader-sap moved this from 🆕 New to 🏗 In progress in Eclipse AAS4J Dev Jul 14, 2023
@sebbader-sap
Copy link
Contributor

see for progress: sap-contributions#3

@mjacoby
Copy link
Contributor

mjacoby commented Jul 17, 2023

The current implementation does not create deep copies, e.g. when using to copy constructor to copy a Submodel, no (deep) copy of the SubmodelElements is done but rather it is copied by reference (see https://github.com/sap-contributions/aas4j/blob/4e2975ff28c4f045fd6e8e4b97966860a98fcdbe/model/src/main/java/org/eclipse/digitaltwin/aas4j/v3/model/impl/DefaultSubmodel.java#L93).

Not sure if this is intended. From my perspective, deep copy is what is needed.

@twebermartins twebermartins added V.1.1.0 Final Release V.1.1.0 incl. additional features and removed V.1.0.0 Final Release V.1.0.0 following EF processes labels Aug 1, 2023
@twebermartins twebermartins moved this from 🏗 In progress to 📋 Backlog in Eclipse AAS4J Dev Oct 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.0 Final AAS V3 Final Release enhancement New feature or request V.1.1.0 Final Release V.1.1.0 incl. additional features
Projects
Status: 📋 Backlog
Development

No branches or pull requests

5 participants