Skip to content

Instantly share code, notes, and snippets.

@stijnvanbael
Last active December 17, 2015 15:59
Show Gist options
  • Save stijnvanbael/5635361 to your computer and use it in GitHub Desktop.
Save stijnvanbael/5635361 to your computer and use it in GitHub Desktop.
Sealed class hierarchy "interface"
public abstract class SealedServices {
Services() {
// Default scoped constructor prevents extension by client
}
public abstract FooService getFooService();
public abstract BarService getBarService();
abstract void validate(); // method we don’t want the client to call
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment