Oop concepts

2,622 views

Published on

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
2,622
On SlideShare
0
From Embeds
0
Number of Embeds
1,577
Actions
Shares
0
Downloads
38
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Oop concepts

  1. 1. OOP ProgrammingMelick R. Baranasooriyamelick-rajee.blogspot.com
  2. 2. Principles of OOP Abstraction InheritanceEncapsulation Polymorphism 2
  3. 3. Inheritance Staff Member GoldLoyalty Non Regular Member 3
  4. 4. Classes and Interfaces Classes Interfaces methods and Methods containFields, properties, properties, left to code for methods be implemented 4 execution later
  5. 5. 5
  6. 6. Inheritancecharacteristics of existing Attributes parent class Operationsextend the Add new Redefine parent fields and methods class methods 6
  7. 7. Extensibility Inheritance Reusability inherits Provides abstraction Eliminatesimplements Extends redundant code 7
  8. 8. 8
  9. 9. Accessibility Levelsprotected internal - limited Private -to the current assembly or types derived from restricted to the the containing class containing typeProtected - Public –limited to the Internal -containing type and limited to the current access is not assembly 9types derived from it restricted
  10. 10. Important AspectsInstance and static constructors No multiple are not inherited inheritanceMultiple Transitive relation Structures cannotinterfaces can be C < - B , B < -A be inheritedimplemented then C <-A 10
  11. 11. Demo Virtual + Sealed Override MultipleMethods + New Access Modifiers Interfaces 11
  12. 12. Abstraction – Reducing the complexity Classes defined with the Class + keyword abstract Interface Not implementedImplemented or methods are Cannot befully declared instantiatedunimplemented 12 abstract
  13. 13. 13
  14. 14. Encapsulation Hides the implementation Public details interface No interfaceAll data members Accessed via members shouldshould be hidden properties be hidden 14
  15. 15. Encapsulation .. Constructors Private data fields and Assessors ReducesChanging the complexity Change fieldsclass internals validation Easierdoes not affect 15 maintenance
  16. 16. Polymorphism ExtensibilityCohesion and Coupling Reusability Having many forms Provides abstraction Virtual Override EliminatesKeyword Keyword redundant code 16
  17. 17. 17
  18. 18. THANK YOU! 18

×