An object that encapsulates a row from a database table or view, by providing access to the database and adding domain logic. Because the data managing operations are implemented directly on the object, it is tightly coupled to the storage technology.
Refactor a private field so that it can only be accessed using getter or setter methods. The advantage is that the accessors can be extended with additional logic without recompiling the client.
Create a new class and move the relevant fields and methods from the old class into the new class.
Extract a code fragment into a new method whose name explains its purpose. The refactoring is a way remove code comments and create small methods.
The MVC pattern separates the domain models (model), the presentation (view), and the actions based on external input (controller) into three separate classes.
A Repository mediates between the domain and data mapping layers, acting like an in-memory domain object collection. Client objects construct query specifications declaratively and submit them to Repository for satisfaction. Objects can be added to and removed from the Repository, as they can from a simple collection of objects, and the mapping code encapsulated by the Repository will carry out the appropriate operations behind the scenes.