Create a gist now

Instantly share code, notes, and snippets.

anonymous /pass-thru.java
Created Feb 25, 2017

What would you like to do?
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