종우의 컴퓨터 공간
What is Object Oriented Programming(OOP)? 본문
What is Object Oriented Programming(OOP)?
종우공간 2021. 9. 21. 09:19What Is Object Oriented Programming?
Object-oriented programming is a computer programming model that organizes software design around objects rather than functions and logics. An object can be defined as a data field that has unique attributes and behavior.
What Is The Structure of Object Oriented Programming?
· Classes are user-defined data types that act as the blueprint for individual objects, attributes, and methods
· Objects are instances of a class created with specifically defined data.
· Methods are functions that are defined inside a class that describe the behaviors of an object.
· Attributes are defined in the class template and represent the state(field) of an object.
What Are The Main Principles of Object Oriented Programming?
· Encapsulation: This principle states that all important information is contained inside an object and only select information is exposed. The implementation and state of each object are privately held inside a defined class. Other objects do not have accesss to this class or the authority to make changes. They are only able to call a list of public functions or methods. This characteristics of data hiding provides greater program security and avoids uninteded data corruption.
· Abstraction: Objects only reveal internal mechanisms that are relevant for the use of other objects, hiding any unnecessary implementation code. The derived class can have its functionality extended. This concept can help developers more easily make additional changes or additions over time.
· Inheritance: Classes can reuse code other classes. Relationships and subclasses between objects can be assigned, enabling developers to reuse common logic while still maintaining a unique hierarchy. This property of OOP forces a more thorough data analysis, reduces development time and ensures a higher level of accuracy.
· Polymorphism: Objects are designed to share behaviors and they can take on more than one form. The program will determine which meaning or usage is necessary for each execution of that object from a parant class, reducing the need to duplicate code. A chile class is then created, which extends the functionality of the parent class. Polymorphism allows different types of objects to pass through the same interface.
What Are The Benefits of Object Oriented Programming?
· Reusability: Code can be reused through inheritance, meaning a team does not have to write the same code multiple times.
· Security: Using encapsulation and abstraction, complex code is hidden, softtware maintenance is easier and internet protocols are protected.
· Flexibility: Polymorphism enables a single function to adapt to the class it is placed in. Different objects can also pass through the same interface.
Reference
https://searchapparchitecture.techtarget.com/definition/object-oriented-programming-OOP
What is Object-Oriented Programming (OOP)?
Learn what object-oriented programming is, its structure, principles and benefits. Also, examine several OOP languages and alternative methods to OOP.
searchapparchitecture.techtarget.com
'Preparing Interviews > Object Oriented Programming' 카테고리의 다른 글
What is abstraction? (0) | 2021.09.24 |
---|---|
What is encapsulation? (0) | 2021.09.22 |