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

by matt392 in Circuits > Software

1640 Views, 13 Favorites, 0 Comments

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

paperpunch.jpg
55b96f11937ddbfcc2000ffa.jpeg
55c9ab254936d4c3ec000b0d.jpeg
55c9ad144fbaded9ef00036b.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. EkTools 2-inch large punch; solid shapes are best.
2. Piece of paper or cardstock.
3. Marker.

Object Oriented Programming Definitions

55c9ab254936d4c3ec000b0d.jpeg
55c9a98415be4d762c00070b.jpeg
55c9a8e7937ddbc446000dd1.jpeg
55c9a9c015be4d762c00070c.jpeg



1. A "class" is defined as the piece of cardstock/paper.
2. The action of punching out a piece of the cardstock/paper with the shape puncher is known as "instantiation" or "creating an instance of the class".
3. Each of the pieces that have been punched out are known as "objects".
4. The different things written on each of the pieces of paper are the objects' "attributes", ie: variable and method names creating custom objects.

Identify the Class

55c9ad7b50e1b690b500075d.jpeg


1. On your piece of cardstock/paper, write down the class name.
2. In this case, we are calling the class "Orange".
3. Next, add a variable and a method that will become part of the objects created from the class.

Create/Instantiate the Object

55c9aacd45bceb7319000726.jpeg
55c9aac515be4d762c000714.jpeg
55c9aa7d4fbaded9ef000364.jpeg
55c9ab1b50e1b690b5000750.jpeg


1. Using the 2 inch hole punch, cut out several shapes.
2. The act of cutting out shapes is known as creating an object, or "instantiation", that is, the creating of an instance of the class.
3. Here, we have punched out several shapes, each one an object of class "Orange".
4. Each object will have the attributes of the class.
5. Note: If it helps with visualization of creating objects, turn the punch over and cut out the shapes with the underside facing up so that you can see the object being created and cut out from the cardstock/paper.

Name the Objects

55c9ab1f4fbade07820000d1.jpeg
55c9ab6615be4d762c000716.jpeg


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

Give the Objects Attributes

55c9ab6e2e7fb67cfd00001c.jpeg
55c9abab937ddbc446000ddc.jpeg
1. Each object has the attributes of class "Orange".
2. Give each of the objects the class attributes (variable/method names) by writing them on each of the objects to customize each object.
3. Now, one can visualize and touch each each custom object created from the same class with a different name and with class attributes for each custom object.
4. For example, here we have created an custom object called "NavelObject" from class "Orange", with the attributes "Variable: Ripe" and "Method: PickFromTree".