


Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
This page cannot be seen from the preview
Don't miss anything!



parsa riaz
Fa18-bse-
The main principles of object-oriented programming are:
Abstraction aims to hide complexity from the users and show them only the relevant information Hides the underlying complexity of data Helps avoid repetitive code Presents only the signature of internal functionality Gives flexibility to programmers to change the implementation of the abstract behaviour Partial abstraction (0-100%) can be achieved with abstract classes Total abstraction (100%) can be achieved with interfaces
Encapsulation allows us to protect the data stored in a class from system- wide access. Restricts direct access to data members (fields) of a class. Fields are set to private Each field has a getter and setter method Getter methods return the field Setter methods let us change the value of the field Restricts direct access to data members (fields) of a class. Fields are set to private Each field has a getter and setter method Getter methods return the field Setter methods let us change the value of the field
Aggregation is a narrower kind of association. It occurs when there’s a one-way (HAS-A) relationship between the two classes you associate through their objects One-directional association. Represents a HAS-A relationship between two classes. Only one class is dependent on the other.
Composition is a stricter form of aggregation. It occurs when the two classes you associate are mutually dependent on each other and can’t exist without each other A restricted form of aggregation Represents a PART-OF relationship between two classes Both classes are dependent on each other If one class ceases to exist, the other can’t survive alone Vedio link: https://youtu.be/n5aTr9hsO6g