Well spotted.. building a data model that's independent of the actual logic is indeed the first step toward grokking OOP.
Taking this idea to a full OO perspective produces the Model-View-Control program architecture:
More generally, we're talking about separation of concerns. You can apply the same concepts perfectly well within the framework of procedural programming. The OO/procedural/functional styles are all just syntactic sugar for the basic computing machinery -- state machines, pushdown automata and the like -- and establishing a clear separation of concerns between your data and the logic that manipulates it is a best practice of any programmming style.
In reply to Re2: passing arguments
by mstone
in thread passing arguments
by mstone
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |