-
Notifications
You must be signed in to change notification settings - Fork 780
Right behavior of getByTags(Set<String> tags) method #1413
Comments
Yes, makes sense to me. |
On the other hand if you have a module type is tagged as Celsius and other which is tagged Kelvin |
I think in your case you should only query for the tag "Temperature" and all is fine. The underlying question of your use case is rather on how we could support hierarchies within tags. This is very much related to #1093 - I think for a start we can live with a "flat list" of tags, but sooner or later we will have to deal with hierarchies as well (so that you can query "all temperature related" module types, independent of whether they deal with Celsius, Fahrenheit or Kelvin). |
…#1413 Signed-off-by: Yordan Mihaylov <[email protected]>
Signed-off-by: Yordan Mihaylov <[email protected]>
Implemented with #1456 |
ModuleTypeRegistry has a method Collection getByTags(Set tags), which returns all the moduleTypes which have been tagged with one of the tags in the filter.
For example:
modulType1 has tags: tag1, tag2
modulType2 has tags: tag1
At the moment getByTags(Set {"tag1"}) will return collection of moduleType1 and moduleType2. The same result will be returned by getByTags(Set {"tag1", "tag2"}) because they both are tagged as "tag1"
Isn't be better if the method getByTags(Set {"tag1", "tag2"}) returns only module types which have been tagged with both tag1 and tag2?
in that way:
getByTags(Set {"tag1"}) will return collection of moduleType1 and moduleType2. - because they satisfied condition to be tagged as "tag1"
getByTags(Set {"tag1", "tag2"}) will returns only moduleType2 because only it has tags "tag1" and "tag2"
The same can be applied to RuleRegistry and TemplateRegistry
The text was updated successfully, but these errors were encountered: