Object-Oriented Programming - Summary

Object-Oriented Programming - Summary

A fourth unit Architecture Design Summary

In the fourth operating unit, by UMLlearning and understanding, our main task is to give most of the code group based curriculum, complete a UMLparser graph.

1. The first job

This time the task is to complete the job of UMLparsing the class diagram, class diagram, there are many objects, I create a table of the properties of these objects of their respective owners, and facilitate the design and programming of late

UmlClass  
parentID ——
name The class name
visibility public/private

 

UmlOperation  
parentID UmlClass
name Method name
visibility public/private

 

UmlParameter  
parentID UmlOperation
name Method name
direction RETURN/IN
type type of data

 

UmlAttribute  
parentID UmlClass
name Property name
visibility public/private

 

UmlGeneralization  
parentID UmlClass
name null
source UmlClass
target UmlClass0

 

UmlInterface  
parentID ——
name Interface name
visibility public/private

 

UmlInterfaceRealization  
parentID UmlClass
name null
source UmlClass
target UmlInterface

 

UmlAssociation  
parentID UmlClass
name null
end1 UmlAssociationEnd1
end2 UmlAssociationEnd2

 

UmlAssociationEnd  
parentID UmlAssociation
name name
reference UmlClass
visibility public/private

 

My idea is: according to UMLclass diagram to build a good example of the initialization phase, so that you can quickly and intuitively find the data required at the time of the query

Where the initialization phase :

Step 1:

assClass: Will ItemClassjoin classesin, will ItemInterfacejoin interfaceesin

assMetAndPro: The ItemPropertyaddition of propertysa queue, ItemOperationadded operations, including whether a parameter and return value

assAssociation: The association of Pair<id1,id2>added associationqueue

Step 2:

assInherit: All the classes and interfaces of parenthoming, all implements an interface class homing

Step 3:

All methods and properties added to the corresponding class, all classes and interfaces associated with the corresponding

After initialization is complete, it can parse and query class diagram in accordance with the requirements of the guide book

 

2, the second job

The second work on the sequence and state diagrams of analytical thinking is consistent with the class diagram, class diagram for the three checks, I direct reference to the data in the class diagram of the initialization phase has been handled well the

UmlRegion  
parentID UmlStateMachine
name name
visibility public/private

 

UmlStateMachine  
parentID UmlClass
name name
visibility public/private

 

UmlPseudostate  
parentID UmlRegion
name name
visibility public/private

 

UmlState  
parentID UmlRegion
name name
visibility public/private

 

UmlFinalState  
parentID UmlRegion
name null
visibility public/private

 

UmlTransition 声明了一个实际的状态转换事件
parentID UmlRegion
name name 该状态转换的名称
guard 该状态转换所能发生的时机(01阈值)
visibility public/private
source UmlState/UmlPseudostate
target UmlState/UmlFinalState

 

UmlEvent  
parentID UmlTransition
name name
expression null
visibility public/private

 

UmlOpaqueBehavior  
parentID UmlTransition
name name
expression null
visibility public/private

 

 

3、架构设计

在设计的时候,我非常不喜欢把所有的代码都堆到一个类里面,首先它肯定会超出500行代码风格的要求,其次也不符合个人美学。我将初始化阶段所用到的方法集中到另一个类中,对于类图、顺序图、状态图、UML类图检查分别在各个类中实现,然后通过实例化对象,调用其中的方法来完成整个代码程序。

 

二、总结自己在四个单元中架构设计及OO方法理解的演进

从刚开始的多项式求导,再到后来的电梯作业,在到后来的地铁站和这次的UML,我对于程序设计的架构是越来越清晰的。

1.可复用性

从最初的代码结构臃肿紊乱,可复用性极差,导致每次都要重新写一份新的代码,对我的任务量可以说是非常大了。但是在这个过程中,我逐渐感受和理解了什么是面向对象编程的思想,学会怎样写出可以复用的代码,学会如何将一个方法抽象出来,甚至以前在C语言、数据结构中没有了解清楚,学的不是很懂的知识,比如说递归、还有各种数据结构,都在这学期的实验课程的实践和使用中更加的熟练。

2.层次化

举个例子,在多项式求导中,将多项式一层一层拆分求导;在UML作业中,逐层根据给出的代码进行建模和实例化......

三、总结自己在四个单元中测试理解与实践的演进

从最初根据数据的合法性进行测试到后来更多的是关注代码的架构和算法的效率,我在这四个单元的实践中越来越关注代码中更为重要的东西,而不是仅仅停留在数据表面。不同的算法带来不同的实践复杂度、空间复杂度,严格的时间要求,所采用数据结构不同而导致不同的代码的复杂度,这些是我在这个过程中慢慢会更加考虑的东西,虽然说在编程的时候,要完全不信任用户的输入,但首先要能够保证我们设计的程序能够按照要求正确地执行好任务,对于正确输入数据的考虑是那之后的事情。

从一开始的扣字眼、再到后来的符合标准的大数据集构造、再到后来的单元化测试,我觉得测试程序是建立在对于要求和程序足够了解熟悉的基础上,这不仅仅是测试程序的正确性与否,更是在测试过程中,对于自己程序架构设计的又一次思考总结和检查。

四、我的收获&感想

1、Java语言的学习

2、对于以前学习到的知识的回顾和加深

3、工程化的思想

4、面向对象的思想

5、各种工具的使用

6、个人认为最重要的一点是,自我学习一项技术的能力

虽然我在这学期的实验中成绩不佳,但这门课程带给我的东西是真切拥有的,第一次完成千行规模代码的程序,第一次写出兼具正确性和个人美学的代码,第一次熬夜到天明解决了bug,第一次明明已经很努力的在写却还是没有在规定时间前完成。

感谢老师们和助教们一学期的教导和努力!

五、建议

1、希望老师能够在学习刚开始的时候给予更多的指导,在最后一个单元吴际老师的暖心贴真的很棒,让我少走了许多的弯路

2、希望课程的时间设置更加的合理,不要上午刚学下午上机就会考察到,多留给我们一下自我学习理解的时间

3、希望课程时间线的设置可以更加的宽裕,这学期加班加点熬夜真的很难受

Guess you like

Origin www.cnblogs.com/Fishtrees-blog/p/11075004.html