November 2024
Intermediate to advanced
300 pages
7h 12m
English
The only remaining oddity in Profile is how it handles scoring logic. Examine its matches method:
| | public boolean matches(Criteria criteria) { |
| | var matcher = new Matcher(criteria, answers); |
| | score = matcher.score(); |
| | return matcher.matches(); |
| | } |
As a side effect, Profile stores a score. But a profile doesn’t have a single fixed score. It only references a calculated score that’s associated with an attempt to match on criteria.
The score side effect causes another problem, which is that a client can’t separate one interest from the other. If a client wants (only) the score for a set of criteria, it must first call the matches() method. This sort ...
Read now
Unlock full access