[Pipet Devel] pygtools tutorial - some definitions
J.W. Bizzaro
bizzaro at bc.edu
Tue Jun 1 21:41:45 EDT 1999
In case you are unfamiliar with some of the terminology of modern object
oriented programming (OOP), here are some plain English definitions and
examples:
"Class" - This is how "objects" are classified.
- Each object belongs to a class or category.
- There is a hierarchical arrangement of objects
"methods" and other classes, under classes.
"Object" - An object is a data structure that can "inherit"
the properties of its parents.
- Objects fall under classes.
"Method" - A method is a function or procedure, which means
it actually does something to something.
- Methods also fall under classes.
"Instance" - A unique copy of a "class" with all of its
methods and objects.
- A change in one instance does not affect
other instances.
"Event" - An event is when something happens in a GUI.
- It can be a mouse movement, button click, etc.
- Event handlers are "methods".
Here is a Python example:
MyClass: # A new class is defined.
def my_method(self, my_number): # A new method is defined
# with the parameter "my_number".
self.my_object = number # A new object is defined.
my_intance = MyClass() # An instance is made.
my_instance.my_method(2) # The method is called.
print my_instance.my_object # This will print "2".
(Let me know if something is wrong here.)
More information about the Pipet-Devel
mailing list