Skip to content

Instantly share code, notes, and snippets.

Created February 25, 2017 05:32
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/7e3f26d010534dc78127f6e42dee0387 to your computer and use it in GitHub Desktop.
Save anonymous/7e3f26d010534dc78127f6e42dee0387 to your computer and use it in GitHub Desktop.
class Controller {
ApplicationService service;
void method(String potentialNull) {
// stuff
if (potentialNull == null) {
service.method();
} else {
service.method(potentialNull);
}
// stuff
}
}
class ApplicationService {
DomainService service;
void method() {
// stuff
service.method();
// stuff
}
void method(String argument) {
// stuff
service.method(argument);
// stuff
}
}
class DomainService {
void method() {
// stuff
DomainObject object = ...
object.method();
// stuff
}
void method(String argument) {
// stuff
DomainObject object = ...
object.method(argument);
// stuff
}
}
class DomainObject {
void method() {
method("reasonable default");
}
void method(String argument) {
// stuff
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment