Encapsulating is a key principle of Object Oriented Programming.
Can ensure data integrity by regulating access.
Update as a whole , rather than individual components.
Question: Does this provide sufficient control??
<aside> 💡 Interaction with State
</aside>
How to do this → Use objects!
railwaydb
.How does user know of the capabilities of private class QueryObject
?
Use an interface!
Interface describes the capability of the object returned in login.
Query Object allows unlimited number of queries.
Add instance variables to object returned on login
Query object can remember the state of the interaction.