Code encapsulation can help you further abstract your project into manageable sections. In this video, learn how to use private properties to prevent unwanted access to sections of your code.
in addition to being able to … get the value of any of the properties in our quiz brain. … So this other class. … We're currently also able to change … any of the properties in our other class. … And, in certain cases, … that can make our app behave in a way that we don't expect. … And so we get onto the second pillar of OOP, … are you a micromanager? … And it's a quiz that checks to see whether if … you're basically trying to micromanage everybody else's time … and you're actually trying to do everybody else's job. … When we're abstracting our classes, … and we're trying to separate out different jobs … into different roles and into different classes, … what we want is for each class to have a separate role … and a separate job and to keep them simple, … we want them to just be concerned with their own jobs … and do their own jobs well. … So, if we have a waiter class and we have a chef class, … we don't want the waiter to be meddling with the chef's job … we don't want the waiter to suddenly say, …
This course was created by London App Brewery. We are pleased to host this content in our library.