Send
Close Add comments:
(status displays here)
Got it! This site "creationpie.com" uses cookies. You consent to this by clicking on "Got it!" or by continuing to use this website. Note: This appears on each machine/browser from which this site is accessed.
Classes and objects
1. Classes and objects
2. Smalltalk
Alan Kay wanted to make a computer so easy to use, a child could use it. Then maybe adults could use a computer.
Steve Jobs saw what Alan Kay was doing and hired him away from Xerox to create the
Apple MacIntosh computer, introduced in 1984.
Alan Kay (American computer scientist) was the originator of
object-oriented, having developed the Smalltalk system in 1971, since "
Children should program in smalltalk".
class: general idea/blueprint of something (cookie-cutter, Platonic forms)
object: instance of a class (cookie, Aristotle potential and actualization)
I invented the term Object-Oriented, and I can tell you I did not have C++ in mind. Alan Kay (American computer scientist)
Smalltalk is an object-oriented language developed by Alan Kay (and others) at Xerox PARC in the 1970s.
Alan Kay wanted to make a computer so easy to use, a child could use it. Then maybe adults could use a computer. Steve Jobs saw what Alan Kay was doing and hired him away from Xerox to create the MacIntosh computer, introduced in 1984.
3. Classes and objects
An understanding of
classes and
objects is essential to understanding object-oriented concepts.
What is an instance?
An instance is a specific occurrence of a general idea.
What is an object?
An object is an instance of a class.
What is a class?
A class is a template for how to make instances of objects.
4. Cars and cookies
General class: Idea of a car.
Specific class: A blueprint is used to create an instance of a car (an actual car)
Object: A Mazda Protege is an instance of the class of cars (produced by Mazda)
5. House analogy
A class is like a blueprint of a house that could be built.
A house object is an instance of a house class.
The house object inherits most of the properties of the house class, but the house object can be customized by making modifications to the class.
6. Classes and objects
A cookie-cutter template is used to create a "
cookie object" as an instance of an idea of a cookie - a "
cookie class".
A class is a general idea of something that relates to a Platonic form.
An object is an instance of a class that relates more the Aristotelian form.
The Platonic idea of an "
empty" class (cookie-cutter) needs to be filled in or "
formed" (cookie dough) in order to create an
Aristotelian object (cookie to be baked) for a "
purpose" or end.
In animated movies, when one sees many similar animals, such as zebras in the movie Madagascar, one of which is "
Marty", each zebra is an
object created from a general zebra
class (as a cookie-cutter template).
7. Reputation
Philippians 2:7 But made himself of no reputation, and took upon him the form of a servant, and was made in the likeness of men: [kjv]
αλλα εαυτον εκενωσεν μορφην δουλου λαβων εν ομοιωματι ανθρωπων γενομενος και σχηματι ευρεθεις ως ανθρωπος [gnt]
… formam … factus … inventus … [v]
The Greek for "
no reputation" is that of "
empty form". An "
empty form" is like a "
hole" as a typed placeholder to be "
informed" with something.
The words "
form" and "
likeness" bring to mind the idea of
Platonic forms and
Aristotelian reality as found today in the class and object ideas of computer science.
The English word
"form" is, through French, from the Latin word
"forme" ≈ "form, shape, appearance" which appears to be from the ancient Greek word
"μορφή" ≈ "shape, fashion, appearance".
8. Object properties, methods and events
|
|
|
An object has specific properties, methods, and reacts to or creates events.
|
Some methods work better than other methods at accomplishing a given task.
|
An event is triggered when something special happens.
|
What is a property of a class?
A property is an attribute of the object. Personal property is something that belongs to a person.
What is a method of a class?
A method is a means to have the object do something (i.e., do an operation).
What is an event of a class?
An event is something that happens.
9. Mouse events
The desktop has properties: screen appearance
Move to an empty of the desktop
Right click
Select "Properties" to see properties of the "Desktop" object.
Select "New" to see some methods of the "Desktop" object.
In most
GUI (Graphical User Interface) architectures, when the mouse moves on the screen, an event is created whenever it enters or leaves a control object such as a link object, a image object, etc. The object receives the message that the mouse is entering, and may change the appearance property of the mouse cursor. Likewise, when the mouse leaves a control object, the object receives a message and can change the cursor back to what it was.
10. The baby class and object
A baby class consists of a general idea of a baby.
A baby object is a specific baby, created by two people as an instance of a baby class.
A baby has properties such as height, weight, skin color, eye color, etc.
Baby methods include the touch method, the see method, the hear method, the feed method, etc.
A baby can create events such as the cry event, the poop event, the hunger event, etc. These events require handling from an outside source.
11. Classes and objects
An understanding of classes and objects is essential to understanding object-oriented concepts.
A class is a general idea of something that relates to a Platonic form. It is a template for how to make instances of objects.
An instance is a specific occurrence of a general idea.
An object is an instance of a class that relates more the Aristotelian form. An object has specific properties, methods, and reacts to or creates events.
12. End of page