Object Oriented Programming: Creating Objects Learning/Teaching Method/Technique Using Scissors

by matt392 in Circuits > Software

1723 Views, 17 Favorites, 0 Comments

Object Oriented Programming: Creating Objects Learning/Teaching Method/Technique Using Scissors

0805152351.jpg
55c65b70937ddbc4460002e9.jpeg

Learning/teaching method for students new to object-oriented programming.
This is a way to allow them to visualize and see the process of creating objects from classes.

Parts:
1. Scissors (any kind will do).
2. Piece of paper or cardstock.
3. Marker.
4. Business card-sized piece of paper or cardstock.

Object Oriented Programming Definitions

55c65c10937ddb2db3000b6d.jpeg
55c655b5937ddb2db3000b48.jpeg

1. A "class" is defined as the piece of orange cardstock/paper.
2. The action of cutting out a piece of the cardstock/paper with the scissors is known as "instantiation", "creating an instance of the class" or creating an object..
3. Each of the pieces that have been cut out are known as "objects".
4. The things written on each of the pieces of paper are the objects' "attributes", ie: variables and methods for that object.

Define the Class

55c9b0df4936d4c3ec000b26.jpeg

1. On the piece of paper/cardstock, write down the name of the class. In this case, it is called "Orange".
2. Next write down the variable and method that will be associated with each object created from the class. Here, the variable is "Ripe" and the method is "PickFromTree".

Create/Instantiate the Object

temp_-1729422474.jpg
0805152351a.jpg
temp_2055744468.jpg

1. Use the business card-size piece of paper/cardstock and marker to trace out 4 boxes.
2. Using the scissors, cut out each square from the sheet/cardstock.
3. The act of cutting out shapes is known as creating an object, or "instantiation", that is, the creating of an instance of the class.
4. Here, we have cut out several shapes, each one an object of class "Orange".
5. Each object will have the properties of the class "Orange".

Name the Objects

55c65a6f4fbade2dfc000024.jpeg

1. Name each of the objects by writing them on the shapes with the marker.
2. Here, they are named "NavelOrange", "ValenciaOrange", "BloodOrange" and "Clementime".

Give the Objects Attributes

55c656874fbade2dfc000023.jpeg

1. Write down the variable and method defined in the class for each object.
2. Here, write down "Variable: Ripe" and "Method: PickFromTree" on each object card.
2. Now, one can visualize and touch each each object created from the Orange class with a different name and the variable/method for each object.