omnifaces / optimusfaces

Utility library for OmniFaces + PrimeFaces combined

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Deduplicate List (iterable)

mydeadlyvenoms opened this issue · comments

I was wondering if it is possible to extend the iterable feature to deduplicate (something like SELECT DISTINCT ... when using SQL) a list of elements. I think there are several situations where this feature could be helpful.

This kind of violates the Law of Demeter. The best is to prepare the model exactly as you'd like the view to present it. I.e. the view should not at all manipulate the model.

I'd therefore rather not implement it. Just fix it in the model side.

Thank you very much for your response @BalusC. Of course, your explanation makes sense but let’s consider the following. Disclaimer: Sorry for the weird scenario (I have a better one in a real-world situation, but it is too cumbersome to explain).

Let’s consider the following scenario: You have a specific group of people (GROUP <-1---*-> PERSON) and now you would like the list all the genders (MALE, FEMALE ...) per group within the DataTable. This is a nice feature because it allows users to make use of the full-text search.

In this scenario the model is correct.