OOP 概念的编程基础思想----我的感想
OOP 概念的編程基礎(chǔ)思想----我的感想
(The essential of OOP concept Thought)
Actually the philosofy of object oriented programming is very simple. What is an object actually? Do you know? Don't think it to complicated,keep it simple. I think you do know, yet you don't realize it when you are perfroming OO programming job. Or Who know you know.
Like in the nature, object is actual what we call "THING". A car is a thing, a bird is a thing, you are a thing too!!!! Don't forget. Object, the thing, is madeup by its parts/components, just like you have a head,a body, two hands and two legs and your tiny thing to make baby. Ha Ha Ha Ha. To be a thing, one has character/propery, has a mean to perform actions,right? Since you have your character and you can move to do some things right. So I think now you get to realize something I want to tell you.
So just like in the nature,object oriented programming(OOP)is all this about like in the nature. An object instant has its propery and its methods to perform jobs to be done.An object belong to some kind, this is so call CLASS. The class is like a kind of group of things with similar propery and methods.
Like in the nature, object,thing can multiplicate themselves. Like you can make babies with the woman you "love" right. Your baby has something in common with you,yet not quite the same, he/she has its own character/propery and he/she growup to be someone with its own behaviour right. So this come to the essential, the foundation of object oriented programming:
1. Inheritant
2. Incaptulation
3. Polymorphism
This is the beauty of Object Oriented Software Engineering,the simulation of the nature, the world we are living. The simplcity of it, and actually we all know about. But unfortunately many C++ and other OO programmers seem to forget some what it is actually very natural and simple!!!! They think in the terms of technique, the syntax, the construction of loop statement,the selection,the branching of code,the constructor, the destroyer, memories allocation,and all kind of tricks in order to get his/her program done.
This is stupib,wrong attitude to become an object oriented programmers. They simply forget the essential,the thought,the foundation of Object Oriented Engineering!!!! So my advice is, keep it simple yet perform it accordingly with correctness. Think and imagine like in the nature.
Just like thing happen and behave in the nature. Nothing secret,nothing complicated. Think like the way it happen in the nature. If a C++ or OO programmer doing his/her programming the way I tell you as above. It will become much and much easier to create even very advanced sophisticated software based on C++ or other OO programming language. This is the way,I think the proper way to perform ones OO programming job. The simplicity,the nature is the beauty!!!!
Bernardus160 于荷蘭 2001-11-12
?
--------------------------------------------------------------------------------
?Bernardus160 回復(fù)于:2001-11-15 07:46:45
OOP 概念的編程基礎(chǔ)思想----我的感想
(The essential of OOP concept Thought)
事實(shí)上,面向?qū)ο?物體)編程的哲學(xué)是非常簡(jiǎn)單的。究竟什么是對(duì)象(物體)呢?你知道嗎?不用(要)把它想的太過(guò)復(fù)雜,其實(shí)它很簡(jiǎn)單。我想你應(yīng)該知道的,只是你在從事面向?qū)ο?物體)編程的工作還未意識(shí)到它,否則,天曉得你知道什么!
?
同自然界一樣,對(duì)象(物體)就是那些被我們稱為“東西”的東西。汽車是個(gè)東西,小鳥是個(gè)東西,你也一樣是個(gè)東西!!!!這一點(diǎn)你可不能忘記哦(雨飛謂: 除非你自己承認(rèn)自己不是東西。^v^嘿嘿~~)。對(duì)象(物體)這個(gè)東西,是由它的各個(gè)部分(被稱為組件)組合而成,就好像你是有頭,身體,雙手,雙腿,和你的那個(gè)生小孩的“小東西”(雨飛謂:俗稱“雞巴”)一樣。哈哈哈哈。作為一個(gè)對(duì)象(物體),當(dāng)然要有自己的特性(被稱為屬性),還意味著會(huì)有動(dòng)作的功能,不是嗎?就像你有你的獨(dú)特性格和你會(huì)以你的性格去做一些事情一樣。我想現(xiàn)在你應(yīng)該意識(shí)到我想對(duì)你說(shuō)些什么了吧。
?
類比與自然界,面向?qū)ο?物體)編程同自然界幾是完全相似的。一個(gè)對(duì)象(物體)實(shí)例有它自己的屬性和完成他自己工作的方法。一個(gè)對(duì)象(物體)屬于某種類型,它被稱為CLASS(類)。類就像是具有相似屬性和方法的一組事物(物體)。
?
形同自然界,對(duì)象(物體)具有繁殖與多種表現(xiàn)形式。就像你和你“愛(ài)”過(guò)的女人生的小貝貝一樣,你的小貝貝會(huì)有一些和你相同的地方,但是也不完全一樣,它還有他自己的個(gè)性特征(屬性)和他自己的特有行為。所以所有這些才是面向?qū)ο?物體)編程的本質(zhì)和基礎(chǔ):
?
1、繼承(遺傳性)
2、封裝(涵存)
3、多態(tài)(一體多樣化)
?
這就是與我們所生活的自然界非常相似的出色(美麗)的面向?qū)ο?物體)軟件工程。事實(shí)上這個(gè)相似點(diǎn)地球人都知道的。但是不幸的是許多從事C++編程和其它面向?qū)ο?物體)語(yǔ)言編程的程序員們好像都忘記了這個(gè)實(shí)際上非常簡(jiǎn)單而自然的東西!!!!他們所想的是有限的技術(shù),語(yǔ)法,循環(huán)、選擇、分支結(jié)構(gòu)的代碼,構(gòu)造,析構(gòu),內(nèi)存分配,和各種各樣為了他們完成代碼的技巧。
?
作為面向?qū)ο?物體)的程序員們這種做法是相當(dāng)愚蠢和錯(cuò)誤的。他們完全忘記了面向?qū)ο?物體)軟件工程的本質(zhì)、思想和基礎(chǔ)!!!!所以我想忠告大家,保持簡(jiǎn)單作法思想性的原則且在進(jìn)行編程時(shí)相應(yīng)地正確行事,以使自己能夠從錯(cuò)誤中糾正過(guò)來(lái)。一切以自然為樣去思考,想象和行事。
?
就像自然界中的事物發(fā)生與演變一樣,沒(méi)有神秘的事物,也沒(méi)有復(fù)雜的事物。對(duì)事物的思考就像它在自然界中發(fā)生那樣想像演變就可以了。如果一個(gè)從事C++或者其他面向?qū)ο?物體)語(yǔ)言程序設(shè)計(jì)的程序員能夠像我以上所說(shuō)的那樣去編制他們的程序,那么將會(huì)更加容易的去構(gòu)建基于C++或者其他面向?qū)ο?物體)程序設(shè)計(jì)語(yǔ)言的高水平先進(jìn)的軟件,而且會(huì)做得更快更好。這只是一條路,一條我認(rèn)為對(duì)從事面向?qū)ο蟪绦蛟O(shè)計(jì)工作比較合適的路。簡(jiǎn)單而自然是最好,最美麗的!!!! ?
總結(jié)
以上是生活随笔為你收集整理的OOP 概念的编程基础思想----我的感想的全部?jī)?nèi)容,希望文章能夠幫你解決所遇到的問(wèn)題。
- 上一篇: raptor流程图赋值语句_用rapto
- 下一篇: 数据挖掘人工神经网络,神经网络的数据处理