-
Notifications
You must be signed in to change notification settings - Fork 41
sdk: Refactor AbstractObjectProvider #430
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
base: develop
Are you sure you want to change the base?
Conversation
s-heppner
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'm fine with the current design, except for the small nitpicks I have in the comments.
I also agree that the newly created methods and classes should be used everywhere in our code.
However: We absolutely need the old methods retained wrapping the new methods with a deprecation warning, otherwise we need to release this as a version 3.0.0, which I don't think we should.
This applies to the methods from:
DictObjectStoreSetObjectStoreLocalFileObjectStore- ...
and all other methods that have been refactored.
| def __init__(self) -> None: | ||
| super().__init__() | ||
| self.administration: Optional[AdministrativeInformation] = None | ||
| # The id attribute is set by all inheriting classes __init__ functions. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd keep the comment here, if it still applies.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why commenting it and not enforcing it through a parameter in the constructor? Besides that, some test cases don't set the ID attribute.
Previously, the `AbstractObjectProvider` only worked with `Identifiables`, which made it incompatible with the new version of the AAS metamodel. This renames and restructures both the `AbstractObjectProvider` and the `AbstractObjectStore`. In all non-abstract subclasses where `Object` appears in the class or method name, it has been replaced with `Identifiable`. Old classes are still available with a deprecation warning. Moreover, `AbstractObjectProvider` and `AbstractObjectStore` are now generic to be able to handle more classes than just `Identifiables`. In order to handle the new `AASDescriptor`, a new class `HasIdentifier` has been added. It is intended to be an abstract superclass for all classes that have an identifier, but are not `Identifiables`. As of now, this PR is intended to serve as a basis for discussion. Therefore, the documentation has not yet been adapted. Fixes eclipse-basyx#428
Previously, the
AbstractObjectProvideronly worked withIdentifiables, which made it incompatible with the new version of the AAS metamodel.This renames and restructures both the
AbstractObjectProviderand theAbstractObjectStore. In all non-abstract subclasses whereObjectappears in the class or method name, it has been replaced withIdentifiable. Old classes are still available with a deprecation warning.Moreover,
AbstractObjectProviderandAbstractObjectStoreare now generic to be able to handle more classes than justIdentifiables.In order to handle the new
AASDescriptor, a new classHasIdentifierhas been added. It is intended to be an abstract superclass for all classes that have an identifier, but are notIdentifiables.As of now, this PR is intended to serve as a basis for discussion. Therefore, the documentation has not yet been adapted.
Fixes #428