"Hello, Amigo! I want you to understand the purpose of OOP. So I'm going to tell you a story."

Once there was a small company that shipped goods to outer space…

"Like Galactic Rush?"

"Yes, like Galactic Rush. 5 people worked there. The first handled finance, the second worked in the warehouse, the third did the shipping, the fourth was in charge of advertising, and the fifth supervised it all."

They worked hard and flourished. The company had a good reputation and made a lot of money. Every year the number of orders increased, so the CEO had to hire more employees. Several for the warehouse, several to do the shipping, another cashier, and a marketer to grow sales.

This is when the problems began. There were more personnel, and they began to interfere with one another.

The marketer spent all the money on a new advertising campaign, leaving no cash on hand to purchase the goods that were urgently supposed to be shipped.

The warehouse had 10 boxes with brand-new hyperdrives to be shipped once a month. One courier flew off with one hyperdrive, causing another client's order for 10 hyperdrives to be delayed another month. The first courier simply didn't know about the other order being fulfilled by the second courier.

The new assistant CEO sent a courier on a ship to purchase goods, and everything else waited for the next available ship. There were plenty of urgent deliveries, but this assistant only managed purchases and was trying to do his job well. The better one person performed his duties, the more he interfered with the rest.

In analyzing the situation, the CEO realized that important resources like the ship, cash, and goods were not being spent optimally, but rather on a "first come, first served" basis. Anyone could take resources to perform their work, threatening the productivity of the rest of the employees and the company.

Something had to be done. The CEO decided to divide the monolithic company into several departments. He created a shipping department, marketing department, purchasing department, finance department, and warehousing department. Now no one could just take the ship. The head of the shipping department received all shipping information and issued the ship to the courier whose delivery would be most profitable for the company. Additionally, the warehouse did not let couriers simply take the goods. They controlled the process. The finance department couldn't allocate money for marketing, if it knew there would be a purchase soon. Each department had one public figure: the department head. The internal structure of each department was its own concern. If a courier wanted to take some goods, he would go to the warehouse manager, not to the warehouse. When a new order came in, it went to the head of the shipping department (public person), not the courier (private person).

In other words, the CEO grouped the resources and actions into departments, and forbade others from interfering with internal departmental structures. Only specific people could be contacted.

In terms of OOP, this is nothing other than splitting a program into objects. A monolithic program, consisting of functions and variables, is converted into a program consisting of objects. And these objects contain variables and functions.

"Wait a minute. So you're saying that the problem was that every employee had unrestricted access to resources and could issue commands to any other employee?"

"Yes, exactly."

"Interesting. We introduced a small restriction, but we received more orders. And they were able to maintain better control of everything."

"Yes. Divide and conquer in its purest form."

"Just as you said, divide and conquer. That's something to remember."