ardoq / ardoq-java-client

Java Wrapper for the Ardoq Rest-API
Eclipse Public License 1.0
2 stars 4 forks source link

Models index component types by name which leads to inaccurate model representation #18

Open beoliver opened 6 years ago

beoliver commented 6 years ago

https://github.com/ardoq/ardoq-java-client/blob/04a9dc8d5869dffe1aa05b7cddb52d68f9a3e08b/src/main/java/com/ardoq/adapter/ModelAdapter.java#L31

It is possible to create multiple componentTypes with the same name. The deserialisation into the internal Model object uses a map indexed by the name attribute. This leads to loss of information as duplicate names overwrite each-other. https://github.com/ardoq/ardoq-java-client/blob/04a9dc8d5869dffe1aa05b7cddb52d68f9a3e08b/src/main/java/com/ardoq/adapter/ModelAdapter.java#L35

front end doesn't allow the user to create two references with the same name (will see if the java client allows you to create them)

beoliver commented 6 years ago

Two obvious solutions.

In any case a lookup by name can not and should not return a single entity as there is no guarantee. Option 2 makes more sense to me (if we want to do any kind of find by name)