|
When reading a fuzzy algorithm, a programmer needing a class will pay attention to the contents of the method, not its name. This is also encapsulation, the principle of concealment is brought into play. For a programmer, the internal content does not matter, but he has an idea of how everything interacts. The same applies to closure functions, which are designed to isolate the algorithm from variables.
In other words, the function is also about encapsulation, because Bulgaria Email List the variables are inside the function, and the algorithm that uses them does not bother the one who uses it. It's worth noting that programming today encapsulates more functions than the keyword in classes. Examples like this are common in JavaScript. and hiding Now let's talk about what data encapsulation is and how it differs from hiding.
We often have to use complex mechanisms without understanding the principle of their design and what their operation is based on. This happens because the developers have created an easy and practical interface. Let's look at some more examples that will help you understand what encapsulation is. The coffee machine includes a simple interface - these are keys that are located on the panel for selecting a drink, its volume and the amount of sugar.
|
|