User Tools

Site Tools


python:python_misc:oo_fundamentals_with_python

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
Next revisionBoth sides next revision
python:python_misc:oo_fundamentals_with_python [2018/08/23 17:07] – [Class-based object-orientation] mithatpython:python_misc:oo_fundamentals_with_python [2018/11/30 18:23] – [Next steps] mithat
Line 69: Line 69:
  
 {{:python:about_python:farberware4241-200.jpeg?nolink|}} {{:python:about_python:farberware4241-200.jpeg?nolink|}}
- 
-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, we would call that master plan a **class**. A class contains all the specifications needed to make a particular kind of object.  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, we would call that master plan a **class**. A class contains all the specifications needed to make a particular kind of object. 
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't addressed the matter of protecting our class' members. But with even with the basics you have learned here, you can now create Python objects whose state is maintained through predefined behaviors.+This just scratches the surface of what's possible with object-oriented programming. In particular, we haven't addressed the matter of protecting our class' members or reusing code through //inheritance//. But with even with the basics you have learned here, you can now create Python objects whose state is maintained through predefined behaviors.
  
 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

Donate Powered by PHP Valid HTML5 Valid CSS Driven by DokuWiki