Skip to content

Instantly share code, notes, and snippets.

@MinCha
Created February 14, 2014 02:58
Show Gist options
  • Select an option

  • Save MinCha/8995058 to your computer and use it in GitHub Desktop.

Select an option

Save MinCha/8995058 to your computer and use it in GitHub Desktop.
Tell, Don`t Ask #2
public class ReadOnlyNotifier {
private List<String> getRelatedServices() {
//
}
public void notifyToRelatedServicesIfItNeeds(StopMessage stopMessage) {
if (getRelatedServices().size() > 0) {
if (notifyToRelatedServices(stopMessage) == false) {
throw new FailedReadOnlyNotificationException();
}
}
}
}
readOnlyNotifier.notifyToRelatedServicesIfItNeeds(stopMessage);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment