SlideShare une entreprise Scribd logo
1  sur  20
Software Development
Fundamentals
Abbasov Ceyhun ( abbasovceyhunn@gmail.com )
Əvvəlki dərs aid suallar
 Obyektin yaradılması
 Obyekt və sinfin fərqi nədir?
 Hüquq təyinedicilər nələrdir? Nə işə yarayırlar?
 Konstruktorlar nədir? Nə işə yarayırlar? Metodlardan fərqləri nələrdir?
 Statik və statik olmayan siniflərin, metodların, xüsusiyyətlərin fərqi nədir?
Mündəricat
 OYP-nin prinsipləri
 İnkapsulasiya. Get və Set
 Varislik
 base və this açar sözlərinin fərqi
 Ev Tapşırığı
OYP-nin prinsipləri
İnkapsulasiya
İnkapsulasiya - sinfin üzvlərini qorumaq üçün, onların istifadəsini
məhdudlaşdırmaq üçün istifadə olunan bir prinsipdir.
İnkapsulasiya. Praktiki nümunə
Aşağıdakı nümunədə yaşı göstərən “age” xüsusiyyətinə istədiyimiz qiyməti
mənimsədə bilərik. Lakin məntiqən bilirik ki, yaş mənfi ola bilməz.
İnkapsulasiya. Praktiki nümunə
Problemin qarşısı almaq üçün “age”
xüsusiyyətini private təyin edərik və ona
müraciət etmək və qiymət mənimsətmək
üçün public metodlardan istifadə edə
bilərik:
Bu proses inkapsulasiya-dır.
İnkapsulasiya. Get və Set
Metodlara GetAge() və SetAge(...) –dən fərqli adlar vermək olar.
Lakin inkapsulasiyada standart olaraq aşağıdakı adlandırma qaydası qəbul
olunmuşdur:
• müraciət etmək üçün: GetXüsusiyyətinAdı()
• qiymət mənimsətmək üçün: SetXüsusiyyətinAdı(…)
İnkapsulasiya. Xüsusiyyətlərin fərqli sintaksisi
İnkapsulasiya
İnkapsulasiya. Visual Studio-dan nümunə
bax: string tipinin Length xüsusiyyətinə
Varislik
Varislik – bir sinfin başqa bir sinfin public və ya protected üzvlərini miras
almağı üçün istifadə olunan bir prinsipdir.
Varislik. Real həyatdan nümunə
Varislik. Övlad sinif və Valideyn sinif
Valideyn sinif - əsas sinifdir.
Övlad sinif – törənmiş sinifdir.
Əvvəlki nümunədə “Insan” valideyn sinif, “Hekim”, “Polis”, “Proqramci” isə övlad
siniflərdir.
Varislik. Tək və Çox varislilik
C# tək varisliliyi dəstəkləyən bir proqramlaşdırma dilidir.
Yəni aşağıdakı yanaşma c#-da qadağandır!
Varislik. C#-da varislik iyerarxiyası
C#-da bütün siniflər avtomatik olaraq Object adlı sinifdən törəyir:
Varislik. Object sinifi
Varislik. base açar sözü
base sözü ilə övlad sinifdən valideyn sinfin üzvlərinə müraciət etmək üçün
istifadə olunur.
Ev Tapşırığı
Sehirli Rəqəmlər oyunundakı obyektləri təyin etmək və varislik iyerarxiyasını
qurmaq.

Contenu connexe

Tendances

Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Mohamed Taman
 
White box & Black box testing
White box & Black box testingWhite box & Black box testing
White box & Black box testingNitishMhaske1
 
Configuration testing
Configuration testingConfiguration testing
Configuration testingRobin0590
 
AI Testing What Why and How To Do It?
AI Testing What Why and How To Do It?AI Testing What Why and How To Do It?
AI Testing What Why and How To Do It?KiwiQA
 
Understanding Unit Testing
Understanding Unit TestingUnderstanding Unit Testing
Understanding Unit Testingikhwanhayat
 
Introduction to Basic Java Versions and their features
Introduction to Basic Java Versions and their featuresIntroduction to Basic Java Versions and their features
Introduction to Basic Java Versions and their featuresAkash Badone
 
Manual testing concepts course 1
Manual testing concepts course 1Manual testing concepts course 1
Manual testing concepts course 1Raghu Kiran
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual TestingDirecti Group
 
Test Automation Trends and Beyond
Test Automation Trends and BeyondTest Automation Trends and Beyond
Test Automation Trends and BeyondKnoldus Inc.
 
Software Testing 101
Software Testing 101Software Testing 101
Software Testing 101QA Hannah
 

Tendances (20)

Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.Unit testing & TDD concepts with best practice guidelines.
Unit testing & TDD concepts with best practice guidelines.
 
White box & Black box testing
White box & Black box testingWhite box & Black box testing
White box & Black box testing
 
Software testing
Software testingSoftware testing
Software testing
 
Typescript ppt
Typescript pptTypescript ppt
Typescript ppt
 
Configuration testing
Configuration testingConfiguration testing
Configuration testing
 
N Unit Presentation
N Unit PresentationN Unit Presentation
N Unit Presentation
 
White Box Testing
White Box Testing White Box Testing
White Box Testing
 
AI Testing What Why and How To Do It?
AI Testing What Why and How To Do It?AI Testing What Why and How To Do It?
AI Testing What Why and How To Do It?
 
Automation testing
Automation testingAutomation testing
Automation testing
 
Understanding Unit Testing
Understanding Unit TestingUnderstanding Unit Testing
Understanding Unit Testing
 
Types of testing
Types of testingTypes of testing
Types of testing
 
AAA Automated Testing
AAA Automated TestingAAA Automated Testing
AAA Automated Testing
 
Introduction & Manual Testing
Introduction & Manual TestingIntroduction & Manual Testing
Introduction & Manual Testing
 
Introduction to Basic Java Versions and their features
Introduction to Basic Java Versions and their featuresIntroduction to Basic Java Versions and their features
Introduction to Basic Java Versions and their features
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Manual testing concepts course 1
Manual testing concepts course 1Manual testing concepts course 1
Manual testing concepts course 1
 
Automated Testing vs Manual Testing
Automated Testing vs Manual TestingAutomated Testing vs Manual Testing
Automated Testing vs Manual Testing
 
Automation With A Tool Demo
Automation With A Tool DemoAutomation With A Tool Demo
Automation With A Tool Demo
 
Test Automation Trends and Beyond
Test Automation Trends and BeyondTest Automation Trends and Beyond
Test Automation Trends and Beyond
 
Software Testing 101
Software Testing 101Software Testing 101
Software Testing 101
 

Plus de Software Development Fundamentals (10)

12. Polimorfizm və Abstrakt siniflər
12. Polimorfizm və Abstrakt siniflər12. Polimorfizm və Abstrakt siniflər
12. Polimorfizm və Abstrakt siniflər
 
10. Obyekt-Yönümlü Proqramlaşdırmaya Giriş
10. Obyekt-Yönümlü Proqramlaşdırmaya Giriş10. Obyekt-Yönümlü Proqramlaşdırmaya Giriş
10. Obyekt-Yönümlü Proqramlaşdırmaya Giriş
 
Say sistemləri
Say sistemləriSay sistemləri
Say sistemləri
 
8. Metodların Davamı
8. Metodların Davamı8. Metodların Davamı
8. Metodların Davamı
 
8. Əlavələr
8. Əlavələr8. Əlavələr
8. Əlavələr
 
5. İstisnaların Davamı
5. İstisnaların Davamı5. İstisnaların Davamı
5. İstisnaların Davamı
 
6. Metodlar
6. Metodlar6. Metodlar
6. Metodlar
 
Software Development Fundamentals Exam 98-361
Software Development Fundamentals Exam 98-361Software Development Fundamentals Exam 98-361
Software Development Fundamentals Exam 98-361
 
2. Proqramlaşdırmaya Giriş
2. Proqramlaşdırmaya Giriş2. Proqramlaşdırmaya Giriş
2. Proqramlaşdırmaya Giriş
 
3. İlk proqram və izahı
3. İlk proqram və izahı3. İlk proqram və izahı
3. İlk proqram və izahı
 

11. İnkapsulasiya və Varislik