SlideShare a Scribd company logo
1 of 43
Бублик Володимир Васильович Програмування - 2 Лекція  9 . Об'єктне програмування. Ієрархія об’єктів і ієрархія класів    Лекції для студентів 2 курсу
Повторення: масив, агрегований в стек  ,[object Object],[object Object]
Зауваження ,[object Object],[object Object],[object Object]
Стек агрегує масив ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Агрегований масив ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Властивості агрегації ,[object Object],[object Object],[object Object],[object Object]
Стек з підгляданням ,[object Object]
Стек з підгляданням ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Спроба реалізації (невдала) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Проблеми ,[object Object],[object Object],[object Object],[object Object]
Дублювання операцій ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Акуратніше підглядання ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Друга спроба реалізації ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Успадкування ,[object Object],[object Object]
Формула (відкритого) успадкування ,[object Object],[object Object],[object Object],[object Object]
Відкрите (повне) успадкування. Приклад ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Правила доступу при успадкуванні (будь-якому) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Створення похідних об'єктів ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Створення похідних об'єктів ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Видалення похідних об'єктів ,[object Object],[object Object]
Відкрите (повне) успадкування. Діаграма композиція успадкування Стек з підгляданням не одержав доступу до  operato r[] , який мав стек
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],Правила доступу: проблема
Знову проблема ,[object Object],[object Object],[object Object],[object Object],[object Object]
Захищена частина класу ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Все ще не дуже вдалий проект: захищений метод ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Стек, спотворений невластивою йому операцією ,[object Object]
Третя спроба реалізації ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Інший вид успадкування ,[object Object],[object Object],[object Object]
Закрите успадкування (реалізації) ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Закрите успадкування (реалізації). Діаграма ,[object Object],[object Object]
Заміна реалізації захищеного методу  ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Четверта спроба реалізації ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Третій вид успадкування ,[object Object]
Транзитивне (захищене) успадкування ,[object Object],[object Object]
Транзитивне успадкування реалізації ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Для стеків успадкування залишається відкритим ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
П'ята (остаточна) спроба реалізації ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Типи успадкувань ,[object Object],[object Object],[object Object],[object Object]
Порівняння агрегації і успадкування ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Порівняння рішень для стеку: агрегація ,[object Object],[object Object],[object Object]
Порівняння рішень для стеку: закрите успадкування (реалізації) ,[object Object],[object Object],[object Object]
Порівняння рішень для стеку: захищене (транзитивне) успадкування (реалізації) ,[object Object],[object Object],[object Object]
Висновок ,[object Object]

More Related Content

Viewers also liked

Lupe Fiasco Grammy Party
Lupe Fiasco Grammy PartyLupe Fiasco Grammy Party
Lupe Fiasco Grammy PartyJennifer Beaver
 
04 Object Hierarchy
04 Object Hierarchy04 Object Hierarchy
04 Object Hierarchyolegapster
 
Lc Presentation
Lc PresentationLc Presentation
Lc Presentationreachab7
 
Holistic Approach
Holistic ApproachHolistic Approach
Holistic Approachreachab7
 
2012 Celebrity Kickoff Party
2012 Celebrity Kickoff Party2012 Celebrity Kickoff Party
2012 Celebrity Kickoff PartyJennifer Beaver
 
06 Data Structures
06 Data Structures06 Data Structures
06 Data Structuresolegapster
 
Transactional Blackbelts are different
Transactional Blackbelts are differentTransactional Blackbelts are different
Transactional Blackbelts are differentreachab7
 
2013 AllStar Celebrity Kickoff Party
2013 AllStar Celebrity Kickoff Party2013 AllStar Celebrity Kickoff Party
2013 AllStar Celebrity Kickoff PartyJennifer Beaver
 
The Race Party - Indianapolis 500 weekend
The Race Party - Indianapolis 500 weekendThe Race Party - Indianapolis 500 weekend
The Race Party - Indianapolis 500 weekendJennifer Beaver
 
2013 pro bowl_maulifoundation_v1
2013 pro bowl_maulifoundation_v12013 pro bowl_maulifoundation_v1
2013 pro bowl_maulifoundation_v1Jennifer Beaver
 

Viewers also liked (15)

Lupe Fiasco Grammy Party
Lupe Fiasco Grammy PartyLupe Fiasco Grammy Party
Lupe Fiasco Grammy Party
 
04 Object Hierarchy
04 Object Hierarchy04 Object Hierarchy
04 Object Hierarchy
 
01 Paradigms
01 Paradigms01 Paradigms
01 Paradigms
 
Lc Presentation
Lc PresentationLc Presentation
Lc Presentation
 
08 Functions
08 Functions08 Functions
08 Functions
 
Holistic Approach
Holistic ApproachHolistic Approach
Holistic Approach
 
2012 Celebrity Kickoff Party
2012 Celebrity Kickoff Party2012 Celebrity Kickoff Party
2012 Celebrity Kickoff Party
 
06 Data Structures
06 Data Structures06 Data Structures
06 Data Structures
 
ProMerch_Marketing
ProMerch_MarketingProMerch_Marketing
ProMerch_Marketing
 
Transactional Blackbelts are different
Transactional Blackbelts are differentTransactional Blackbelts are different
Transactional Blackbelts are different
 
2013 AllStar Celebrity Kickoff Party
2013 AllStar Celebrity Kickoff Party2013 AllStar Celebrity Kickoff Party
2013 AllStar Celebrity Kickoff Party
 
2013 BRANDed
2013 BRANDed 2013 BRANDed
2013 BRANDed
 
The Race Party - Indianapolis 500 weekend
The Race Party - Indianapolis 500 weekendThe Race Party - Indianapolis 500 weekend
The Race Party - Indianapolis 500 weekend
 
2013 pro bowl_maulifoundation_v1
2013 pro bowl_maulifoundation_v12013 pro bowl_maulifoundation_v1
2013 pro bowl_maulifoundation_v1
 
Rafale startup101
Rafale startup101Rafale startup101
Rafale startup101
 

Similar to 09 Object And Class Hierarchy

Net framework і c# module 13
Net framework і c# module 13Net framework і c# module 13
Net framework і c# module 13Andrii Hladkyi
 
11 Iterated Containers
11 Iterated Containers11 Iterated Containers
11 Iterated Containersolegapster
 
10 Polymorphism
10 Polymorphism10 Polymorphism
10 Polymorphismolegapster
 
Using Metatags in Flex Developing
Using Metatags in Flex DevelopingUsing Metatags in Flex Developing
Using Metatags in Flex DevelopingRoman Shuper
 
05 Operations And Utilities
05 Operations And Utilities05 Operations And Utilities
05 Operations And Utilitiesolegapster
 

Similar to 09 Object And Class Hierarchy (7)

Net framework і c# module 13
Net framework і c# module 13Net framework і c# module 13
Net framework і c# module 13
 
11 Iterated Containers
11 Iterated Containers11 Iterated Containers
11 Iterated Containers
 
10 Polymorphism
10 Polymorphism10 Polymorphism
10 Polymorphism
 
08 Templates
08 Templates08 Templates
08 Templates
 
Using Metatags in Flex Developing
Using Metatags in Flex DevelopingUsing Metatags in Flex Developing
Using Metatags in Flex Developing
 
05 Operations And Utilities
05 Operations And Utilities05 Operations And Utilities
05 Operations And Utilities
 
cpp-2013 #20 Best practices
cpp-2013 #20 Best practicescpp-2013 #20 Best practices
cpp-2013 #20 Best practices
 

More from olegapster

06 Pointers To Class Members
06 Pointers To Class Members06 Pointers To Class Members
06 Pointers To Class Membersolegapster
 
03 Right Of Access
03 Right Of Access03 Right Of Access
03 Right Of Accessolegapster
 
02 Copying Objects
02 Copying Objects02 Copying Objects
02 Copying Objectsolegapster
 
07 Localisation
07 Localisation07 Localisation
07 Localisationolegapster
 
09 Static Polymorphism
09 Static Polymorphism09 Static Polymorphism
09 Static Polymorphismolegapster
 
03 Constants And Variables
03 Constants And Variables03 Constants And Variables
03 Constants And Variablesolegapster
 
02 Arithmetic Data Types
02 Arithmetic Data Types02 Arithmetic Data Types
02 Arithmetic Data Typesolegapster
 

More from olegapster (9)

06 Pointers To Class Members
06 Pointers To Class Members06 Pointers To Class Members
06 Pointers To Class Members
 
03 Right Of Access
03 Right Of Access03 Right Of Access
03 Right Of Access
 
02 Copying Objects
02 Copying Objects02 Copying Objects
02 Copying Objects
 
07 Localisation
07 Localisation07 Localisation
07 Localisation
 
05 Arrays
05 Arrays05 Arrays
05 Arrays
 
09 Static Polymorphism
09 Static Polymorphism09 Static Polymorphism
09 Static Polymorphism
 
04 Operators
04 Operators04 Operators
04 Operators
 
03 Constants And Variables
03 Constants And Variables03 Constants And Variables
03 Constants And Variables
 
02 Arithmetic Data Types
02 Arithmetic Data Types02 Arithmetic Data Types
02 Arithmetic Data Types
 

Recently uploaded

"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil TopchiiFwdays
 
Тестування Blockchain - Що там можна тестувати?
Тестування  Blockchain - Що там можна тестувати?Тестування  Blockchain - Що там можна тестувати?
Тестування Blockchain - Що там можна тестувати?Oleksandr Romanov
 
"Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl..."Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl...Fwdays
 
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y..."How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...Fwdays
 
"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro Spodarets"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro SpodaretsFwdays
 
"Distributed graphs and microservices in Prom.ua", Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua", Maksym KindritskyiFwdays
 

Recently uploaded (6)

"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
"GenAI Apps: Our Journey from Ideas to Production Excellence",Danil Topchii
 
Тестування Blockchain - Що там можна тестувати?
Тестування  Blockchain - Що там можна тестувати?Тестування  Blockchain - Що там можна тестувати?
Тестування Blockchain - Що там можна тестувати?
 
"Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl..."Rethinking the existing data loading and processing process as an ETL exampl...
"Rethinking the existing data loading and processing process as an ETL exampl...
 
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y..."How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
"How Preply reduced ML model development time from 1 month to 1 day",Yevhen Y...
 
"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro Spodarets"What is a RAG system and how to build it",Dmytro Spodarets
"What is a RAG system and how to build it",Dmytro Spodarets
 
"Distributed graphs and microservices in Prom.ua", Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi"Distributed graphs and microservices in Prom.ua",  Maksym Kindritskyi
"Distributed graphs and microservices in Prom.ua", Maksym Kindritskyi
 

09 Object And Class Hierarchy

  • 1. Бублик Володимир Васильович Програмування - 2 Лекція 9 . Об'єктне програмування. Ієрархія об’єктів і ієрархія класів Лекції для студентів 2 курсу
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18.
  • 19.
  • 20.
  • 21. Відкрите (повне) успадкування. Діаграма композиція успадкування Стек з підгляданням не одержав доступу до operato r[] , який мав стек
  • 22.
  • 23.
  • 24.
  • 25.
  • 26.
  • 27.
  • 28.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40.
  • 41.
  • 42.
  • 43.