Restricted Method Access
This page is an Extract Page refactoring to serve as a landing page whenever I talk about restricting access to methods to only certain objects.
- Method Regulation
- Friend Class Pattern
- JUID – Just Use Interfaces, Dummy
- Package-private / internal assembly / friend access
- Discouraging method names – instead of getProductId(), say breachEncapsulationOfProductId()
- Stringent code reviews – weaker version of Method Regulation
- Double Dispatch – multimethods for languages that don’t have them
- Builder pattern – similar to JUID
This is the list as of October 2008. If I come up with more, or find some in the archives I missed, I will add them as they come.
Code Agitator, elected to be the villain, certified a menace

