oop概念_OOP的基本概念

oop概念

The object oriented programming has been developed with a view to overcome the drawbacks of conventional programming approaches. The OOP approach is based on certain concepts that help it attain its goal of overcoming the drawbacks of shortcomings of conventional programming approaches. These general concepts of OOP are given below:

Also Read: How to write and run c/c++ programs in Ubuntu

1. Data Abstraction

Abstraction refers to the act of representing special features without including the background details or explanation.

 2. Encapsulation

The wrapping up of data and operations/ functions (that operate on the data) into a single unit (called class) is known as encapsulation.

3. Modularity

Modularity is a property of a system that has been decomposed into a set of cohesive and loosely coupled modules.

4. Inheritance

Inheritance is the capability of one class of things to inherit capabilities or properties of another class.

5. Polymorphism

Polymorphism is the ability for a message or data to be processed in more than one form.

Advantages of OOP

  1. It models real world well.
  2. With OOP, programs are easy to understand.

  3. OOP offers classes reusability. Already created classes can be reused without having to write them again.
  4. OOP facilitates Quick Development as parallel development of classes is possible.
  5. With OOP, programs are easier to test manage and maintain.

Disadvantages of OOP

  1. With OOP, classes tend be overly generalised.
  2. The relations among classes become artificial at times.
  3. The OOP programs design is tricky.
  4. Also one needs to do proper planning and proper design for OOP programming.
  5. To program with OOP, programmer need proper skills such as design skills, programming skills, thinking in terms of objects etc.
Source: Text Book: C++ Sumita Arora

翻译自: https://www.thecrazyprogrammer.com/2012/07/basic-concepts-of-oop.html

oop概念

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值