详细研究 Python 中的面向对象编程 (OOP) 功能

Nzerue-Kenneth P.E., Onu F.U, Denis A.U., Igwe J.S., Ogbu N.H.
{"title":"详细研究 Python 中的面向对象编程 (OOP) 功能","authors":"Nzerue-Kenneth P.E., Onu F.U, Denis A.U., Igwe J.S., Ogbu N.H.","doi":"10.52589/bjcnit-facsojao","DOIUrl":null,"url":null,"abstract":"Human beings are naturally classified; OOP is closely aligned to how human brains work. The Mathematical functional approach is a more rigorous way to capture an idea; it is more difficult to transpose and the code is not easily readable. To overcome the limitations of procedural, structural, and functional programming, OOP was developed. Because of its versatility, it supports various programming styles which include maintenance, addition and overriding; however, modification of existing code is made easier. OOP programs prevent you from repeating code, making developers choose OOP in their python program because a class can be defined once and reused many times (Thelin, 2020). By the end of this article, you will be able to create classes, instantiate objects from them, and integrate the four methods of OOP by creating modules of Python projects. With the basic concept of OOP in Python, this article has shown how we can hide our data by making it private (abstraction), allowing for code reusability (inheritance), constraining dependency management through polymorphism and rapping data and function together to prevent data from being accessed by the code outside this shield (encapsulation).","PeriodicalId":326452,"journal":{"name":"British Journal of Computer, Networking and Information Technology","volume":"18 1","pages":""},"PeriodicalIF":0.0000,"publicationDate":"2023-11-29","publicationTypes":"Journal Article","fieldsOfStudy":null,"isOpenAccess":false,"openAccessPdf":"","citationCount":"0","resultStr":"{\"title\":\"Detailed Study of the Object-Oriented Programming (OOP) Features in Python\",\"authors\":\"Nzerue-Kenneth P.E., Onu F.U, Denis A.U., Igwe J.S., Ogbu N.H.\",\"doi\":\"10.52589/bjcnit-facsojao\",\"DOIUrl\":null,\"url\":null,\"abstract\":\"Human beings are naturally classified; OOP is closely aligned to how human brains work. The Mathematical functional approach is a more rigorous way to capture an idea; it is more difficult to transpose and the code is not easily readable. To overcome the limitations of procedural, structural, and functional programming, OOP was developed. Because of its versatility, it supports various programming styles which include maintenance, addition and overriding; however, modification of existing code is made easier. OOP programs prevent you from repeating code, making developers choose OOP in their python program because a class can be defined once and reused many times (Thelin, 2020). By the end of this article, you will be able to create classes, instantiate objects from them, and integrate the four methods of OOP by creating modules of Python projects. With the basic concept of OOP in Python, this article has shown how we can hide our data by making it private (abstraction), allowing for code reusability (inheritance), constraining dependency management through polymorphism and rapping data and function together to prevent data from being accessed by the code outside this shield (encapsulation).\",\"PeriodicalId\":326452,\"journal\":{\"name\":\"British Journal of Computer, Networking and Information Technology\",\"volume\":\"18 1\",\"pages\":\"\"},\"PeriodicalIF\":0.0000,\"publicationDate\":\"2023-11-29\",\"publicationTypes\":\"Journal Article\",\"fieldsOfStudy\":null,\"isOpenAccess\":false,\"openAccessPdf\":\"\",\"citationCount\":\"0\",\"resultStr\":null,\"platform\":\"Semanticscholar\",\"paperid\":null,\"PeriodicalName\":\"British Journal of Computer, Networking and Information Technology\",\"FirstCategoryId\":\"1085\",\"ListUrlMain\":\"https://doi.org/10.52589/bjcnit-facsojao\",\"RegionNum\":0,\"RegionCategory\":null,\"ArticlePicture\":[],\"TitleCN\":null,\"AbstractTextCN\":null,\"PMCID\":null,\"EPubDate\":\"\",\"PubModel\":\"\",\"JCR\":\"\",\"JCRName\":\"\",\"Score\":null,\"Total\":0}","platform":"Semanticscholar","paperid":null,"PeriodicalName":"British Journal of Computer, Networking and Information Technology","FirstCategoryId":"1085","ListUrlMain":"https://doi.org/10.52589/bjcnit-facsojao","RegionNum":0,"RegionCategory":null,"ArticlePicture":[],"TitleCN":null,"AbstractTextCN":null,"PMCID":null,"EPubDate":"","PubModel":"","JCR":"","JCRName":"","Score":null,"Total":0}
引用次数: 0

摘要

人类天生就会分类;OOP 与人类大脑的工作方式密切相关。数学函数式方法是一种更严谨的捕捉思想的方法;它更难以移植,代码也不容易阅读。为了克服过程式、结构式和函数式编程的局限性,OOP 应运而生。由于其多功能性,它支持各种编程风格,包括维护、添加和覆盖;不过,修改现有代码变得更加容易。OOP 程序避免了代码重复,这使得开发人员在 Python 程序中选择了 OOP,因为一个类可以定义一次并重复使用多次(Thelin,2020)。本文结束时,您将能够创建类、从类中实例化对象,并通过创建 Python 项目模块整合 OOP 的四种方法。有了 Python OOP 的基本概念,本文展示了我们如何通过将数据私有化(抽象)来隐藏数据,允许代码重用(继承),通过多态性约束依赖管理,以及将数据和函数封装在一起以防止数据被屏蔽外的代码访问(封装)。
本文章由计算机程序翻译,如有差异,请以英文原文为准。
Detailed Study of the Object-Oriented Programming (OOP) Features in Python
Human beings are naturally classified; OOP is closely aligned to how human brains work. The Mathematical functional approach is a more rigorous way to capture an idea; it is more difficult to transpose and the code is not easily readable. To overcome the limitations of procedural, structural, and functional programming, OOP was developed. Because of its versatility, it supports various programming styles which include maintenance, addition and overriding; however, modification of existing code is made easier. OOP programs prevent you from repeating code, making developers choose OOP in their python program because a class can be defined once and reused many times (Thelin, 2020). By the end of this article, you will be able to create classes, instantiate objects from them, and integrate the four methods of OOP by creating modules of Python projects. With the basic concept of OOP in Python, this article has shown how we can hide our data by making it private (abstraction), allowing for code reusability (inheritance), constraining dependency management through polymorphism and rapping data and function together to prevent data from being accessed by the code outside this shield (encapsulation).
求助全文
通过发布文献求助,成功后即可免费获取论文全文。 去求助
来源期刊
自引率
0.00%
发文量
0
×
引用
GB/T 7714-2015
复制
MLA
复制
APA
复制
导出至
BibTeX EndNote RefMan NoteFirst NoteExpress
×
提示
您的信息不完整,为了账户安全,请先补充。
现在去补充
×
提示
您因"违规操作"
具体请查看互助需知
我知道了
×
提示
确定
请完成安全验证×
copy
已复制链接
快去分享给好友吧!
我知道了
右上角分享
点击右上角分享
0
联系我们:info@booksci.cn Book学术提供免费学术资源搜索服务,方便国内外学者检索中英文文献。致力于提供最便捷和优质的服务体验。 Copyright © 2023 布克学术 All rights reserved.
京ICP备2023020795号-1
ghs 京公网安备 11010802042870号
Book学术文献互助
Book学术文献互助群
群 号:481959085
Book学术官方微信