|
|
| Line 280: |
Line 280: |
|
| |
|
|
| |
|
| Inheritance has the added advantage of providing a means to customize class behavior without having to modify the actual class, because all member fields can be parametrized.
| |
|
| |
|
| For example, a "cumulus" cloud class could be derived from the "cloud" class, just by parametrizing it (different cloud model, different texture, different transformations), without touching anything in the actual "cloud" class.
| |
|
| |
| This is basically how OOP may be understood: things are classified according to "is a" or "has a" relationship.
| |
|
| |
| Of course, one may still use objects like conventional variables for passing and returning parameters.
| |
|
| |
|
|
| |
|