OOP 概念的编程基础思想----我的感想
OOP 概念的編程基礎思想----我的感想
(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 回復于:2001-11-15 07:46:45
OOP 概念的編程基礎思想----我的感想
(The essential of OOP concept Thought)
事實上,面向對象(物體)編程的哲學是非常簡單的。究竟什么是對象(物體)呢?你知道嗎?不用(要)把它想的太過復雜,其實它很簡單。我想你應該知道的,只是你在從事面向對象(物體)編程的工作還未意識到它,否則,天曉得你知道什么!
?
同自然界一樣,對象(物體)就是那些被我們稱為“東西”的東西。汽車是個東西,小鳥是個東西,你也一樣是個東西!!!!這一點你可不能忘記哦(雨飛謂: 除非你自己承認自己不是東西。^v^嘿嘿~~)。對象(物體)這個東西,是由它的各個部分(被稱為組件)組合而成,就好像你是有頭,身體,雙手,雙腿,和你的那個生小孩的“小東西”(雨飛謂:俗稱“雞巴”)一樣。哈哈哈哈。作為一個對象(物體),當然要有自己的特性(被稱為屬性),還意味著會有動作的功能,不是嗎?就像你有你的獨特性格和你會以你的性格去做一些事情一樣。我想現在你應該意識到我想對你說些什么了吧。
?
類比與自然界,面向對象(物體)編程同自然界幾是完全相似的。一個對象(物體)實例有它自己的屬性和完成他自己工作的方法。一個對象(物體)屬于某種類型,它被稱為CLASS(類)。類就像是具有相似屬性和方法的一組事物(物體)。
?
形同自然界,對象(物體)具有繁殖與多種表現形式。就像你和你“愛”過的女人生的小貝貝一樣,你的小貝貝會有一些和你相同的地方,但是也不完全一樣,它還有他自己的個性特征(屬性)和他自己的特有行為。所以所有這些才是面向對象(物體)編程的本質和基礎:
?
1、繼承(遺傳性)
2、封裝(涵存)
3、多態(一體多樣化)
?
這就是與我們所生活的自然界非常相似的出色(美麗)的面向對象(物體)軟件工程。事實上這個相似點地球人都知道的。但是不幸的是許多從事C++編程和其它面向對象(物體)語言編程的程序員們好像都忘記了這個實際上非常簡單而自然的東西!!!!他們所想的是有限的技術,語法,循環、選擇、分支結構的代碼,構造,析構,內存分配,和各種各樣為了他們完成代碼的技巧。
?
作為面向對象(物體)的程序員們這種做法是相當愚蠢和錯誤的。他們完全忘記了面向對象(物體)軟件工程的本質、思想和基礎!!!!所以我想忠告大家,保持簡單作法思想性的原則且在進行編程時相應地正確行事,以使自己能夠從錯誤中糾正過來。一切以自然為樣去思考,想象和行事。
?
就像自然界中的事物發生與演變一樣,沒有神秘的事物,也沒有復雜的事物。對事物的思考就像它在自然界中發生那樣想像演變就可以了。如果一個從事C++或者其他面向對象(物體)語言程序設計的程序員能夠像我以上所說的那樣去編制他們的程序,那么將會更加容易的去構建基于C++或者其他面向對象(物體)程序設計語言的高水平先進的軟件,而且會做得更快更好。這只是一條路,一條我認為對從事面向對象程序設計工作比較合適的路。簡單而自然是最好,最美麗的!!!! ?
總結
以上是生活随笔為你收集整理的OOP 概念的编程基础思想----我的感想的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: raptor流程图赋值语句_用rapto
- 下一篇: DeepLearing—CV系列(二十二