-
Notifications
You must be signed in to change notification settings - Fork 39
Description
Custom cache implementations are used throughout the FDP app.
For example:
- CacheConfig
- FormsAutocompleteCache
- ResourceDefinitionCache
- ResourceDefinitionTargetClassesCache
- SearchFilterCache
- SettingsCache
Probably it would be more robust, and clearer, to use Spring's annotation-based caching integration, using e.g. @Cacheable, etc.
Here's at least one problem with the current implementation:
-
The
ResourceDefinitionCachegetters are marked as possibly "not needed anymore".
Actually it looks like both getter query the repository directly instead of relying solely on the cached data:FAIRDataPoint/src/main/java/org/fairdatapoint/service/resource/ResourceDefinitionCache.java
Lines 74 to 76 in e746e9a
public ResourceDefinition getByUuid(UUID uuid) { // TODO: not needed anymore? return resourceDefinitionRepository.findByUuid(uuid).orElse(null); FAIRDataPoint/src/main/java/org/fairdatapoint/service/resource/ResourceDefinitionCache.java
Lines 79 to 80 in e746e9a
public Set<ResourceDefinition> getParentsByUuid(UUID uuid) { // TODO: not needed anymore?