Organizing data
How data is organized is one of the most important aspects of our profession; coherently aggregating information forms the foundation for building a solid, maintainable, and extensible software project. Various types of refactoring assist us in this regard, and once again, Fowler helps us navigate them in great detail. In the upcoming sections, we will present a selection of those we consider to be the most common or potentially misleading.
Field encapsulation
We will group together in a single section techniques that we believe are very similar to each other and ultimately concerned with not revealing the internal structure of a class to its users. This principle is known as encapsulation and is one of the fundamental concepts of object-oriented programming (OOP); hiding the internal structure of a class and providing access methods to its fields is beneficial because it simplifies the use of the class, protects data, improves maintainability, encapsulates behavior...