Skip to content

Conversation

@mateusmolina-iese
Copy link
Member

@mateusmolina-iese mateusmolina-iese commented Feb 6, 2025

Linked to the 1st Phase of #584

This PR refactors the backend architecture for the Submodel, AAS, ConceptDescription repositories/services, the AASXFileServer, and the AasDiscoveryService to (1) rely on existing CrudRepository implementations when available -- for example, MongoDB -- and (2) use backend-specific implementation for the services.

Following a similar implementation strategy of #570, with the following changes:

  1. The AAS/SubmodelOperations backend-specific fragment is now registered by adding the corresponding implementation bean to the META-INF/spring.factories file, instead of relying on a BeanPostProcessor.
  2. The Aas/SubmodelServiceFactory is reused in the AAS/SubmodelRepository. This change was necessary so that the repositories could reuse the features implemented at the service level. To work without compromising the added benefits of the refactoring, a similar architecture to the one used in Aas/SubmodelRepositories was implemented in the Aas/SubmodelServices based on the CrudRepository (from Spring).

Other than that, this PR brings several other changes:

  1. A more consolidated and error-proof mapping of a given entity with the collection name for the MongoDB backends
  2. An UUID-based generation of package IDs for the AASXFileServer -- enabling the persistence of the packages stored
  3. Refactor AASXFileServer to store packages using the unified FileRepository
  4. Add support to MongoDB backend for the AASService
  5. General clean-code-related fixes in tests and removal of obsolete/unused code related to the backend

Suggestions for future work:

  1. Remove the service-related methods from the interfaces of the AAS/SubmodelRepository, eliminating their dependency on the AAS/SubmodelServiceFactories. This greatly simplifies the dependency structure and architecture and avoids unnecessary proxies.
  2. Instead, the AAS/SubmodelServiceFactories should be used directly in the AAS/SubmodelControlers as a component for implementing the service-related methods.

@mateusmolina-iese mateusmolina-iese force-pushed the feat/refactor-other-repos-arch branch from 99142cf to 04e6f5d Compare February 19, 2025 08:33
# Conflicts:
#	basyx.submodelrepository/basyx.submodelrepository-backend/src/main/java/org/eclipse/digitaltwin/basyx/submodelrepository/backend/CrudSubmodelRepository.java
@mateusmolina-iese mateusmolina-iese force-pushed the feat/refactor-other-repos-arch branch 2 times, most recently from aa8cd46 to 3008c3a Compare February 20, 2025 13:23
@mateusmolina-iese mateusmolina-iese force-pushed the feat/refactor-other-repos-arch branch from 3008c3a to 44a0da6 Compare February 20, 2025 13:30
@mateusmolina-iese mateusmolina-iese force-pushed the feat/refactor-other-repos-arch branch from f39636a to d5df214 Compare February 20, 2025 14:05
# Conflicts:
#	basyx.aasrepository/basyx.aasrepository-feature-mqtt/src/test/java/org/eclipse/digitaltwin/basyx/aasrepository/feature/mqtt/TestMqttV2AASAggregatorObserver.java
#	basyx.submodelrepository/basyx.submodelrepository-feature-mqtt/src/test/java/org/eclipse/digitaltwin/basyx/submodelrepository/feature/mqtt/TestMqttSubmodelObserver.java
#	basyx.submodelservice/basyx.submodelservice-feature-mqtt/src/test/java/org/eclipse/digitaltwin/basyx/submodelrepository/feature/mqtt/TestMqttSubmodelObserver.java
@mateusmolina-iese mateusmolina-iese marked this pull request as ready for review February 24, 2025 12:25
@mateusmolina-iese mateusmolina-iese changed the title Refactor Backend Architecture for the remaining Repositories Refactor Backend Architecture for the remaining Repositories, AASXFileServer and AasDiscoveryService Feb 24, 2025
@aaronzi aaronzi merged commit 132d373 into eclipse-basyx:main Feb 25, 2025
27 checks passed
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