Skip to content
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

Change List<Contact> to Contacts? #7

Open
fabriciofx opened this issue Nov 12, 2018 · 3 comments
Open

Change List<Contact> to Contacts? #7

fabriciofx opened this issue Nov 12, 2018 · 3 comments

Comments

@fabriciofx
Copy link
Owner

@amihaiemil I've read your post An Extension To TellDontAsk and I liked very much. Congratulations! So, based on it, I'm thinking change the SqlContacts code here to return a Contacts instead of a List<Contacts>. To achieve this, I must implement a FilteredContacts, as you've suggested on post. So, my doubt is: how do you think should be the constructor signature? FilteredContacts(final List<Contacts> found, final String name)?

@amihaiemil
Copy link

@fabriciofx hi and thanks for your feedback! I will have a look over your questiins (also the ones from Disqus) and will answer over the weekend (very busy week now)

@fabriciofx
Copy link
Owner Author

@amihaiemil Ok! Thanks in advance!

@amihaiemil
Copy link

amihaiemil commented Nov 18, 2018

@fabriciofx Well, depends on the moment you want to make the filtering: do you want the SQL server to directly return the contacts respecting the filter, or do you want to fetch them all and filter them in-memory yourself?

I would go with the first option (fetch them already filtered), so I think your FilteredContacts should be built uisng the Session and a Map or filters (or however you want to store your filters).

Later, think about how the FilteredContacts will behave if you call filter(...) on it many times: will it keep the previously specified filters or will it flush and use only the ones specified at the latest filter(...) method call?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants