python:python_misc:oo_fundamentals_with_python
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revisionNext revisionBoth sides next revision | ||
python:python_misc:oo_fundamentals_with_python [2018/08/23 17:07] – [Class-based object-orientation] mithat | python:python_misc:oo_fundamentals_with_python [2018/11/30 18:28] – [Behavior] mithat | ||
---|---|---|---|
Line 40: | Line 40: | ||
==== Behavior ==== | ==== Behavior ==== | ||
- | A given microwave oven also has predefined **behavior**. | + | A given microwave oven also has predefined **behavior**: |
* //Push the " | * //Push the " | ||
- | * //Push the " | + | * //Push the " |
* //Push a magical combination of buttons// → set the internal clock. | * //Push a magical combination of buttons// → set the internal clock. | ||
* And so on. | * And so on. | ||
- | These operations are ones that happen to be public-facing (i.e., operations a user can engage). There might very well also be operations that go on inside the oven to support the oven's functioning | + | These operations are ones that happen to be public-facing (i.e., operations a user can engage). There might very well also be operations that go on inside the oven that the user will never be aware of to support |
==== Encapsulation and protection ==== | ==== Encapsulation and protection ==== | ||
Line 69: | Line 69: | ||
{{: | {{: | ||
- | |||
- | Because OOP models itself after real-world objects, we're going to use a real-world object to explore some more OOP concepts. | ||
I have a Farberware 4241 microwave oven in my office. It's small, but it gets the job done. There is a factory somewhere making these by the thousand million, and they make all the Farberware 4241s from a master plan. That master plan defines what the Farberware 4241 //is//. In computing terminology, | I have a Farberware 4241 microwave oven in my office. It's small, but it gets the job done. There is a factory somewhere making these by the thousand million, and they make all the Farberware 4241s from a master plan. That master plan defines what the Farberware 4241 //is//. In computing terminology, | ||
Line 269: | Line 267: | ||
==== Next steps ==== | ==== Next steps ==== | ||
- | This just scratches the surface of what's possible with object-oriented programming. In particular, we haven' | + | This just scratches the surface of what's possible with object-oriented programming. In particular, we haven' |
Copyright © 2011-2018 Mithat Konar. All rights reserved. | Copyright © 2011-2018 Mithat Konar. All rights reserved. |
python/python_misc/oo_fundamentals_with_python.txt · Last modified: 2018/11/30 18:45 by mithat