A black box is a term that engineering works like this. First, drop something into the black box. Then, wait while it is up to us “magically transformed” within it. Finally, we received a new result in the same black box The beauty is that it’s all you need to know is how to return a certain entry adadoa not need to understand the magic inside.
* Well, that means anyone, but the object itself needs to know anything about their properties and methods defined and implemented .
* Are the list of items stored in a matrix or a vector? How is the classification, with a fast or a kind of bubble guy? How is a marked selection and how to handle multiple selections ?
* Encapsulation means that the answers to all these questions are private, known only by the object itself .
* What is the benefit this?
* Well, the advantage is that if you want to use a Select box, it is not necessary to address all the complex code that takes care of all the functionality of a select box. Instead, I just put the self-contained, select the object of my application and use .
* This is an incredibly useful concept because it means that it is much easier to understand and change the code because it only need to deal with small pieces of code in a given time. As a developer, there’s no need to address the complexities of selecting the box functionality, just use the thing !
* It is also a good metaphor for the real world, which can be thought of as being composed of encapsulated objects.
* Consider the computer you’re using to read this. Do you know how the CPU? Most likely you do not. But that’s great. It operates independently. And the fact that you do not have to spend time learning of electrical engineering means you are free to spend his time building things “through” the CPU.