Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature Request: Cleaner interfaces #2

Open
brianjahnke opened this issue May 20, 2021 · 1 comment
Open

Feature Request: Cleaner interfaces #2

brianjahnke opened this issue May 20, 2021 · 1 comment
Labels
enhancement New feature or request

Comments

@brianjahnke
Copy link

Hi,

all Infomodel Object interfaces seem to share common functions, such as getId(), toRdf, setProperties and getProperties.

  1. I would like to propose to segregate the "fat" IDS interfaces and rather compose the IDS interfaces by using single purpose interfaces. E.g.:
// Maybe even make key and values generic?
public interface DynamicProperties<K, V> {
    void setProperty(K key, V value);
    Map<K, V> getProperties();
}

By defining such it would be possible to operate on IDS objects in a generic way. E.g. call toRdf on all IDS objects regardless if they are ResourceCatalogs or Artifacts (which is currently not possible, see definition of Catalog and Artifact).

  1. Further i would like to propose to remove duplications in interface definitions.
    e.g. When looking at the definition of a ResourceCatalog it definies functions like getId, toRdf. But those are already definied in the parent interface Catalog.

It gets even more complicated when looking at classes like Representation that inherit multiple interfaces, but all are defining those functions. This makes interfaces larger then they need to be and it obscures how a e.g. ResourceCatalog differs from a Catalog.

  1. Maybe this could be fixed by defining a common shared base interface? Something like IdsObject? This IdsObject would inherit those single purpose interface (defined in 1) and every IDS Object would inherit from IdsObject. This would also allow to narrow the scope of generic functions and classes because it would allow the usage of <? extends IdsObject>. At the moment such scoping is not possible since the only common interface is the java base class Object.
@maboeckmann maboeckmann added the enhancement New feature or request label Jun 17, 2021
@maboeckmann
Copy link
Contributor

Hi Brian,
almost as in #1, we have started working on this suggestion and created some generalizing interfaces. The first improvements, covering most of what you suggest here, should be ready in roughly three weeks from today.
Thanks for the great suggestions!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

2 participants