|
|
|
|
|
by svieira
401 days ago
|
|
One way you could fix this with composition is: class CachedMetadataSource implements MetadataSource {
CachedMetadataSource(MetadataSource uncachedSource) {}
Metadata getMetadata() {
if (metadata == null) {
metadata = uncachedSource.getMetadata();
}
return metadata;
}
}
|
|