Skip to content

sdk: Refactor AbstractObjectProvider#430

Open
moritzsommer wants to merge 7 commits intoeclipse-basyx:developfrom
rwth-iat:fix/428
Open

sdk: Refactor AbstractObjectProvider#430
moritzsommer wants to merge 7 commits intoeclipse-basyx:developfrom
rwth-iat:fix/428

Conversation

@moritzsommer
Copy link
Contributor

@moritzsommer moritzsommer commented Nov 3, 2025

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. The refactoring includes:

  1. DictObjectStore -> DictIdentifiableStore
  2. SetObjectStore -> SetIdentifiableStore
  3. LocalFileObjectStore -> LocalFileIdentifiableStore
  4. CouchDBObjectStore -> CouchDBIdentifiableStore

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.

The docs, comments and variable names have been adapted accordingly.

Fixes #428

@moritzsommer moritzsommer marked this pull request as draft November 3, 2025 19:41
@moritzsommer moritzsommer reopened this Dec 1, 2025
@moritzsommer moritzsommer marked this pull request as ready for review December 1, 2025 17:44
Copy link
Contributor

@s-heppner s-heppner left a 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:

  • DictObjectStore
  • SetObjectStore
  • LocalFileObjectStore
  • ...

and all other methods that have been refactored.

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
Copy link
Contributor

@s-heppner s-heppner left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Is this ready to be merged now?

Btw, it looks like your Linter is configured to a shorter line length than defined (historically) in our project. We demand a maximum 120 characters per line, as per our CI (therefore, shorter is fine as well.)

@moritzsommer
Copy link
Contributor Author

Btw, it looks like your Linter is configured to a shorter line length than defined (historically) in our project. We demand a maximum 120 characters per line, as per our CI (therefore, shorter is fine as well.)

My local linter is also set to a line length of 120 characters. However, I never split words or other structural elements of the documentation, e.g. :class:`AbstractObjectProviders <.AbstractObjectProvider> must remain in one line. If this exceeds the character limit of the current line, it must be pasted onto the next line, which might create a big blank space in the current line. Do you handle it differently? Or where does it look like I am using the wrong settings?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants