It’s time to put your objects to work. It starts by thinking about the work (behavior) that a user would do. How is your code going to use and work with the object? Let’s talk through the different behaviors, such as checking if the user is logged in, changing password, etc.
Then let’s make an object work by calling one of the methods. Remember, that in OOP, the keyword
function is referred to as a “method” (confusing I know).
Then let’s stop for a moment and see if you are grasping the concept of objects. Notice that you created two separate users. Each one is completely separate. They were made from the same class blueprint. But notice that their information is different (i.e. the properties/characteristics/attributes). They are separate objects. When you work with one, you are not affecting the other one.
Whoever says that coding is hard, just smack them.
Total Lab Runtime: 03:04:55
- 1 Lab Introductionfree 08:27
- 2 What is Object-Oriented Programming (OOP)?free 14:14
- 3 What is an object?free 13:30
- 4 Meet the Class Blueprintpro 04:53
- 5 Creating an Objectpro 07:57
- 6 Defining Characteristicspro 10:54
- 7 Putting the Object to Workpro 13:56
- 8 Hiding Away the Complexitypro 22:40
- 9 Working within the Object with $thispro 15:41
- 10 Internal Control of Object Creationpro 15:07
- 11 Class Constantspro 08:58
- 12 Class Staticpro 17:49
- 13 What OOP is Notpro 19:11
- 14 Practical Examplespro 04:52
- 15 Wrap it Uppro 06:46