Karumi / Rosie

Rosie is an Android framework to create applications following the principles of Clean Architecture.
Other
1.82k stars 156 forks source link

Searching in repositories #81

Closed lujop closed 8 years ago

lujop commented 8 years ago

How do you implement searches in repositories (eg paginated results where user can filter by a text expression)?

Is the intended usage to use a repository factory that creates a repository for search result? If this is the intended usage how do you implement caching? Did you use some type of repository caching, manually create appropriate caching datasources? Or simple recreate all and try to move caching to upper levels like http request/response caching.

I think that this is a pretty common repository use case and will be nice to have some support in the framework and example usage in the sample.

pedrovgs commented 8 years ago

Hi @lujop!

You can use the current repositories implementation adding a key to search containing the page and the search param you need and the repository will automatically catch all your results using the TTL you've configured.

Is this the answer to your question?

lujop commented 8 years ago

Yes thanks,