BUAAOO fourth unit summary

--- --- restore content begins

An architecture, the present job unit twice

Thirteenth job: The job I created four classes, classes outside the Main and MyUmlInteraction official removal, as well as Uclass and Ulinterface corresponding respectively to store classes and interfaces. Generating a completion and a corresponding new class name and id mappings of these classes MyUmlInteraction class. After the attributes, operations, like inheritance property is found by mapping the appropriate class or interface is then added. Which is slightly difficult point is the class that implements the interface, in this regard, I fill all of its parent interfaces from recursive interface, then all inherited class in order to achieve complete re-filling all the interfaces of the class. When the query directly to the appropriate classes and interfaces can call its internal function. (But MyUmlInteraction this assignment generate too many new classes and complete inheritance of operation makes many of which function is independent inquiry, I should be packaged in these operations generated a new class).

Bug: The work intensity measurement is not wrong point.

Second job: work the first time and are not very different, nothing more than add a state diagram and sequence diagram, so I increased the new data structure StateDiagram and InteractionDiagram two categories to manage these two graphs, then a layer package, StateDiagram Machine class management, Machine State class management layer. InteractionDiagram is the same operation.

For three add a check, I did not add the operation, but added that a direct directly inherit inheritance and interface implementation class, inherited by the new cycle map and the map repeated inheritance, whenever the DFS discovery Inheritance cycle is added into the map found on behalf of the parent class repeat repeated inheritance, added to the map, the last as long as the two map through the process can be completed check a little work. FIG class as follows.

Bug appears: null pointer did not notice problems caused WA

Second, the architecture design and OO methods to improve the understanding of

The first unit: a job, beginner java, not even the language proficiency, not to mention the architecture. Fall into a class, the structure is bad bad, but the use of regular expressions is reasonable, without the use of regular expressions long, but rather while (m.find) {m.group ()} split structure of the expression discrimination, thereby reducing the explosive emergence of the stack.

到后面作业二和作业三能稍微理解分层设计,将数据结构一层层封装,将数据分成Exp、Term、Factor类,并在这三层之间形成递归关系从而完成运算。经过这三次作业,我在代码的层次化,基本架构上有所提高,同时对于程序的鲁棒性也有所理解。

第二单元:第一次接触多线程问题,难点在于同步互斥和数据传递。我的抽象化能力有所提高,看待电梯问题,明确什么是捎带,什么是电梯,捎带就是电梯仍然就是这么去接人,只不过接人的路上可能可以捎带上别人,它的接人方向和放人方向始终没有任何变化,因此我就将电梯的属性做了很大的调整,楼层的概念变得没那么重要,而方向作为主要属性,接人方向,放人方向和接人的极限层(即从接人任务结束的那一层)作为电梯每次开始运作的基础,然后每一层再给它分配任务,而不对这三个属性做任何变化。这是我对电梯的抽象,而在同步控制方面,我使用的是电梯去竞争请求,多部电梯和任务的关系是竞争关系,电梯去竞争任务而不是靠调度器调度任务,对调度器加锁,每次只有一部电梯可以进行调度,其他电梯就得等待。这就使整个多线程问题变的简单,当然在性能上面略显不足。

通过这一单元的学习,我对数据的交互、保护,对线程的同步互斥有了了解,同时对看待问题的抽象能力也有所提高,在架构方面也有了不小的提升。

第三单元:这一单元学JML,它是用于对Java程序进行规格化设计的一种表示语言,也因此,我们有了一个新的视角,即开发者、架构者的角度来看待问题。在这一单元,其实架构并没有引起我们困惑,因为官方包已经大大降低了我们的难度,加上JML语言的指导,其实本次的架构是最简单的,只要在相应的类中添加一些map等数据结构,对某些数据进行建图,运算保存,就可以完成。但是大家都觉得这次作业很简单,我不这么认为,因为我的算法能力实在是有些薄弱,对于建图,迪杰斯特拉这些本应该分分钟秒杀的算法,我却一而再再而三卡住,导致这个单元我的作业分数非常低。

本单元的作业对我来说就是个算法作业,在架构方面我学到了JML语言的严谨和对实现代码的帮助巨大,当然更学到了算法的重要性和基础性,很菜很真实。

第四单元:本单元引进了UML类图、顺序图、状态图,本单元对架构能力的锻炼应该是最好的。我们需要先理解UML各个元素的关系,其在数据方面的关系的表达,我们对数据的提取、存放、查找,这些都是很锻炼我们架构能力的。

 

三.四个单元中测试理解与实践的演进

第一个单元完全靠理解代码架构和实现方法来看逻辑是否有误,再附加一些自己造的数据来适当测试完成测试环节。其实第四单元的第一次作业我也是这么测试的,当然这种测试方法很危险,无法覆盖,出bug率很高,而且对一些很细微很愚蠢的bug会视而不见,比如有一次作业我的equal写成了==导致了错误,最后也是靠不断地数据测试,再定位找到的。

在后面几个单元,由于代码结构的庞大,代码量的增加,纯靠眼看代码是不可取的。对拍器也是我所采用的一种测试方式,虽然暴力但是有效,暴力的覆盖测试还是对于我们这些一千行不到的代码最有效的测试方法。

Junit测试,这种测试本应该很有效,但是由于懒得构造数据造成我没怎么使用过这个方法

四、课程收获

学到的不仅仅是JAVA这个语言的规范,更多的是对整个设计流程的理解,包括对问题的抽象化,如何构建数据结构,对数据的保护和传递,等等在设计方面需要我们考虑的因素。而在课程之外,还学到了心态别崩,google百度,看待一个问题要留一手,要持有怀疑态度,这些也是其他很多普通课程不曾带给我们过的。总之,OO课不是一门普通的课,它锻炼我们的脑子,锻炼我们的思维方式,更锻炼我们的心态。这是一门十分有趣、有挑战、令人回味的课程。

 

五、课程意见

1.关于实验课,感觉本学期实验课并不能学到很多东西,时间安排有些问题,同时部分内容也不是很好,或者说让我有些懵。有次关于继承和实现的实验内容很好,但是时间不够,之后也就不了了之。

2.作业难度应该循序渐进,开头难度有些过高,让大家对于架构的思考太少。

3.关于架构能力的指导可能还是少了一些,理论课上讲的某些东西还是过大或者说过高于我的水平,是否能提供一些更接地气的指导,提供更多的架构实例和讲解让我们更能一步一步的理解架构。

 

Guess you like

Origin www.cnblogs.com/Therp-GY/p/11078442.html