Created
March 16, 2018 14:26
-
-
Save deque-blog/c43497a3c80e7201e9791f8987d3843e to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class SuggestPopularFriendPost { | |
private final IAccessProfileInfo profileInfo; // Injected with constructor | |
public Iterable<PostSummary> suggestedPostsFor(ProfileId profileId) { | |
// Same code as before, calling `friendsOf`, `favoriteTopicsOf` and `lastPostsOf` | |
} | |
private Iterable<ProfileId> friendsOf(ProfileId profileId) { | |
return profileInfo.friendsOf(profileId); // Rerouting to `IAccessProfileInfo` | |
} | |
private Set<Topic> favoriteTopicsOf(ProfileId profileId) { | |
return profileInfo.favoriteTopicsOf(profileId); | |
} | |
private Stream<PostSummary> lastPostsOf(ProfileId profileId) { | |
return stream(profileInfo.lastPostsOf(profileId)); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment