- make attributes private (or protected) and use getters and setters instead of accessing attributes directly.