对象英文是object, 带有很强的客观味道。可是在认识论中,纯粹客观是不存在的。由于客观世界是不可知的(见康德相关著做)。从这个角度讲,相对于从客观的角度去理解对象这个词,还不如从认识论的角度去理解它。由于显然的,一切都是认识。人脑中的一切概念,都是主观的。这样理解,其实发现如今对面向对象的主流认识即领域建模,实际上是一种对“对象”的哲学认识的通俗认识。app
生活就是哲学,难道不是吗?dom
因此在面向对象分析的时候,辨别什么是对象其实很容易,你认为它是什么,那么它就是什么。这是一种什么逻辑呢?它其实就是一种语言逻辑。也即,你日常是怎么描述它的,那么它就“是”什么。或者说,你想怎么描述它,它就“是”什么。它“是”什么由你决定。ui
由于真正的客观并不存在。有人可能会以三维存在来决定一个事物是否对象。但是三维自己其实也只是一种性质,按照实在论的观点,它并不优先于其它的事物属性。也就是说,一切原本就都是性质。只不过通过人类大脑或认识的须要整理事后,造成如今的“物质”或者说惟物观。可是咱们要解决的所有问题,其实都只在咱们大脑的内部,跟客观世界其实没有任何关系。只要解决了大脑内的“问题”,全部问题也就都解决了。由于“问题”自己,也只存在于咱们的理解中。一旦去除了理解,还有什么可以“存在”呢?lua
人,活在语言中。 spa
而使用面向对象进行需求分析与设计的好处则在于它使得语言中的两个重要元素:主语与谓语,的表达同时成为可能。这是它与过程范式的最大区别,由于过程范式只有谓语,没有主语。它的表达能力太有限。这也是为何使用它开发出来的系统具备高耦合特性的缘由。面向过程的系统只有一个主语,那就是系统。而一个由大量谓语构成的功能式系统,天然只能是一个高耦合系统。.net
使用面向对象的范式,在分析时只需先对系统进行一遍(或多遍)陈述,而后找出其中的主语,而后找出其中的谓语,这些找出来的主语与谓语,就是系统分析的结果。这里很容易看出的是,“陈述”相当重要。也就是说,我怎么陈述系统,系统就将是什么样子的。系统将是我陈述的样子。这是面向对象的精髓。而至于系统分析之后的系统设计,其实在很大程度上只是一些技术层面上的工做,并不会影响系统的逻辑结构。好比,系统跑在什么平台上固然很重要,可是这个重要性,固然远远不如系统的逻辑结构“重要”。甚至,若是采用的平台合适的话,支撑系统实际上是能够随时替换的。设计
根据维基百科的定义,OOA是:orm
Object-oriented analysis (OOA) applies object-modeling techniques to analyze the functional requirements for a system对象
OOD则是:ip
Object-oriented design (OOD) elaborates the analysis models to produce implementation specifications
Generally:
OOA focuses on what the system does, OOD on how the system does it.
This means that OOA defines the system itself, and OOD defines the way to implement it.
I don't agree with it because it has a 'system' in it. I mean, when we\re talking about object oriented anything, then when we're really doing 'anything', we should also be really oriented, only, to 'objects', not anything else, including 'system'. because if we're not, then maybe the word OOSA and OOSD should be used instead of OOA, OOD. Right?
再看这一段:
The result of object-oriented analysis is a description of what the system is functionally required to do, in the form of a conceptual model. That will typically be presented as a set of use cases, one or more UML class diagrams, and a number of interaction diagrams. It may also include some kind of user interface mock-up. The purpose of object oriented analysis is to develop a model that describes computer software as it works to satisfy a set of customer defined requirements.
是否是很矛盾?
面向对象分析的结果是一种在以概念模型为形式的,关于系统在功能上应该作些什么的描述。?,,而且,后面却不再说起概念化模型(这种文章显然是由某个对面向对象概念理解还不够的人写出来的)。。。什么是类图?类图?对象图呢?类比对象还重要?类不是对象的蓝图吗?对象在系统中处于第几位?1st?2nd?
可是在接下来的OOD中又这样说起:
Object-oriented design (OOD) transforms the conceptual model produced in object-oriented analysis to take account of the constraints imposed by the chosen architecture and any non-functional – technological or environmental – constraints, such as transaction throughput, response time, run-time platform, development environment, or programming language.
The concepts in the analysis model are mapped onto implementation classes and interfaces. The result is a model of the solution domain, a detailed description of how the system is to be built.
上面OOA根本就没有任何真正的“概念模型”文档,然而这里却说从“概念模型”开始。。。。?
为何咱们会被误导?!
Though if we skip the argument about them being definitions, we can also see one valuable point in it which indicates that OOD is nothing to do with the definition of 'objects' but only implementing them. This is a good news because it means that all (complicated, abstracted, fragile?)object oriented things will be done before the design phase, or that the people who's doing the OOD job doesn't need to worry about anything which is connected to modeling because modeling's not really a easy job for everyone. Actually, it's quite a challenge for most people 'cause it requires either a lot of experiences or knowledges about the modeling domain or a lot of wisdom to understand the problem.
找出主语和谓语是近乎机械化的过程,这里基本上不会有什么问题。难的地方是,面向对象虽然不是功能导向的,但它至少是存在一个问题域(或问题空间)的。问题空间指问题所存在的空间,而面向对象的目的就是为了实现这个空间(在使用领域建模的思想时。由于前面提过,面向对象的实现手段不少,根据问题的不一样,可使用随意的对象模型,即便这个模型与真实的问题空间没有任何关系)。所以,真正的挑战其实在于如何更好地实现这个空间(或其它的空间---即整个对象系统。也即,系统中有些什么对象)!