class ComponentResourceImpl implements ComponentResource {

    @Override
    public Dependencies getDependencies(final String[] ids) {
        if (ids.length == 0) {
            return new Dependencies(emptyMap());
        }
        final Map<String, DependencyDefinition> dependencies = new HashMap<>();
        for (final String id : ids) {
            if (virtualComponents.isExtensionEntity(id)) {
                final DependencyDefinition deps = ofNullable(virtualComponents.getDependenciesFor(id))
                        .orElseGet(() -> new DependencyDefinition(emptyList()));
                dependencies.put(id, deps);
            } else {
                final ComponentFamilyMeta.BaseMeta<Object> meta = componentDao.findById(id);
                dependencies.put(meta.getId(), getDependenciesFor(meta));
            }
        }
        return new Dependencies(dependencies);
    }

}