Csongor Józsa

26%
Flag icon
Encapsulation We like to keep our variables and utility functions private, but we’re not fanatic about it. Sometimes we need to make a variable or utility function protected so that it can be accessed by a test. For us, tests rule. If a test in the same package needs to call a function or access a variable, we’ll make it protected or package scope. However, we’ll first look for a way to maintain privacy. Loosening encapsulation is always a last resort.
The Robert C. Martin Clean Code Collection (Collection) (Robert C. Martin Series)
Rate this book
Clear rating
Open Preview