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
DataTable: add reflection based LazyDataModel, similar to JpaLazyDataModel #8395
Comments
WDYT about @Rapster? should we provide something or even replace our current Sort/FilterFeature with something like this? DataTable must wrap a value-binding with a In theory the code MUST be faster and cleaner with this. We just need a good place to cache the PropertyDescirptors. |
I like where you are going with it! |
I think it definitely worth to try and see how far you can go with this 😉 Please make a PR so we can follow your progress |
Sound´s interresting. Thinking about implications of this:
|
I use a property for a global filter (search query string) in my lazy model, as well as a two maps of properties of columns of which I need a sum or a count. Support in the lazy model for a certain operation on certain columns would be a nice addition (maybe needs a different ticket). |
@christophs78 no, that would not change |
so in best case, we filter once per request, for each request the datatable must be rendered |
@tandraschko - i agree to you. |
|
Why not go all the way with the reflection? :) |
update the code now |
This comment was marked as off-topic.
This comment was marked as off-topic.
Actually i would like to contribute this type of LazyDataModel to PF and also write a example + doc i mean, the benefits are clear:
but we provide another way of using the DataTable |
I like it you could call it ReflectionLazyDataModel and add it ? Can you add it without disturbing the Sort/FilterFeature. |
Needs to be done one a feature-branch + PR. |
Commited the ReflectionDataModel now as we use it in some projects already, also added some tests |
I'd like to review this but I need to know if you're done with it? If I remember well, the whole idea is to replace |
yep, i'm roughly done with it We dont need to replace anything, it's just an idea for the future and has some benefits. |
JFYI, simple case normal list vs ReflectionLazyDataModel sorting 10000 entries:
not used a profiler and using an extreme case but it seems saving not only a few CPU |
This sounds good to me! |
added docs; closing it for now |
even reworked the getting started a bit and added new |
@melloware @Rapster please review i think in general we miss such hints or best practices for many components |
LGTM. And you are probably right about this could be done in a lot more places. |
I'm currently reviewing/refactoring/polishing the new lazy models, I'll submit a draft PR soon and would like to see it for 14 |
Currently we have 2 possible solutions (and maybe more?) to use a DataTable:
List<MyPojo>
LazyDataModel
in 1) sorting and filtering is done via our SortFeature+FilterFeature, whereas in 2) its done in the LazyDataModel itself
There are some benefits with a LazyDataModel, compared to the old/non-lazy way:
What we need to discuss in future is:
Should we force people to use a LazyDataModel when filtering and sorting is activated?
Using Jpa or ReflectionLazyDataModel definitily leads to a better performance (anyonse interessted in creating a small benchamark?) and big lists will be avoided in ViewState.
The text was updated successfully, but these errors were encountered: