C++Tutorial for Beginners 52 - Encapsulation

preview_player
Показать описание
-------------------------------------------------------------------------------------------------------------------------------------------
This video; Encapsulation is another vital object-oriented concept, involving hiding away the workings of your program and exposing only a documented set of public methods.
--------------------------------------------------------------------------------------------------------------------------------------------
Рекомендации по теме
Комментарии
Автор

very nice video, hide private function inside the public function, brilliant...

amer
Автор

Mr. Purcell, I have several books that speak about this subject, but 2 of them stick out the most. Where Getters/Setters are bad practice to do and that a class should always have a way of getting data on it's own when possible. But in another book it states that it's a fine to work with those as it doesn't mess with the integrity of the data. In your personal opinion do you think it is bad practice to do getters/setters? Another question is how about Friend function/classes does this undermine the encapsulation in OOP.? If not would you recommend using a Friend at all for your programming?

From my understanding about OOP style, you want to keep all data integrity encapsulated and have as much things in private as possible if it does not require the end user to access it for any reason. But it would seem a friend function kinda goes around this style. In your years of programming how are Friends typically used?

Mort
Автор

Buddy u have so less views than u deserve. people dont like c++ i guss.

ankitlakhanpal