python:python_misc:oo_fundamentals_with_python
Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revision | Next revisionBoth sides next revision | ||
python:python_misc:oo_fundamentals_with_python [2018/11/30 18:28] – [Behavior] mithat | python:python_misc:oo_fundamentals_with_python [2018/11/30 18:39] – [Class-based object-orientation] mithat | ||
---|---|---|---|
Line 70: | Line 70: | ||
{{: | {{: | ||
- | 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 | + | 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. They make all the Farberware 4241s from a master plan, a plan that defines what the Farberware 4241 //is//. In object-oriented design |
- | Every Farberware 4241 begins its life identical to every other freshly-made Farberware 4241 because they were made using the same master plan. So, the one in my office that I pulled out of the box last month was identical to the one that I bought my best friend last week later because they were built from the same master plan, or, if you will, the same class. | + | Languages that support **class-based object-oriented programming** let you define classes at a very high level. Once you've defined a class you can then create **instances**: |
- | In **class-based object-oriented programming**, | + | Thus my oven is an instance of a Farberware 4241, and you might say the Farberware factory spends it's entire day instantiating 4241 ovens. |
==== Prototype-based object-orientation ==== | ==== Prototype-based object-orientation ==== |
python/python_misc/oo_fundamentals_with_python.txt · Last modified: 2018/11/30 18:45 by mithat