Object-oriented fourth unit and Lessons Learned blog

Object-oriented course final summary blog

The fourth section summarizes the job twice architecture design

  UmlClass and a unifying feature package contemplated UmlInterface

The evolution of the four units in structuring and understanding of OO methods

  Reusability

  Maintenance and expansion

  safety

  Structured approach

Four unit tests to understand the evolution and practice

Summarize their course harvest

A little advice

 

Summarizes the architectural design of this unit twice a job

"First mind map impress"

 

UmlClass and a unifying feature package contemplated UmlInterface

The first job

Only three classes, inner Feature contains a corresponding UmlClass or UmlInterface's UmlElement, like the institution of a unified management

Dependency metrics          
Class Cyclic Dcy Dcy* Dpt Dpt *
Feature 0 0 0 1 2
Main 0 1 3 0 0
MyUmlInteraction 0 2 2 1 1
Class OCavg WMC
Feature 2.72 49
Main 1 1
MyUmlInteraction 4.42 84

Obviously, the complexity of the three classes too big, a very large class, have a high degree of repeat some of the functions of the code is relatively redundant

Second job

Dependency metrics          
Class Cyclic Dcy Dcy* Dpt Dpt *
ClassInteraction 0 1 1 1 2
Feature 0 0 0 2 3
Main 0 1 9 0 0
MyUmlGeneralInteraction 0 6 8 1 1
SequenceInteraction 0 1 1 1 2
SequenceStuff 0 0 0 1 3
StateInteraction 0 1 1 1 2
StateStuff 0 0 0 1 3
TypeJudge 0 0 0 1 2

Several class second job setting, to balance the code among different files, it is not so bloated.

By UML modeling, we could before starting to write code on their own to construct a more clear in mind, planned to write code after the Bug will be less. Here we are just providing a possible way of modeling what specific choice depends on your requirements.

 

Summarizes the evolution of their own in four units in structuring and understanding of OO methods

This term contact with the object oriented course that, in the four units, two units of the front stumbled to the third and fourth intensity measurement units for all jobs are out, thanks to maturing and object-oriented architecture of understanding gradual .

Reusability

  • Through inheritance, we can dramatically reduce redundant code and extend the use of existing code

Maintenance and expansion

  • Because of inheritance, encapsulation, polymorphism characteristics, it can be designed with high cohesion, low coupling system configuration, making the system more flexible and easier to expand, and low cost. Based on object-oriented systems are also more likely to escalate from small to large.

safety

  • 数据隐藏的概念帮助程序员们保护程序免受外部代码的侵袭,允许一个对象的多个实例同时存在,而且彼此间不会相互干扰

结构化方法

结构化方法的本质是功能分解,功能分解:把问题整体功能的单个处理着手,自顶向下不断把复杂问题分解为子处理,这样一层一层地分解下去,直到仅剩下若干个容易实现的子处理功能为止。因此,结构化方法是围绕实现处理功能的“过程”来构造系统的,而用户需求的变化大部分是针对功能的,用户需求的变化往往造成系统结构的较大变化。

所以如果一个架构足够完善的话,就不会出现,次次重构次次爽(一次重构火葬场)

 

 

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

第一个单元还是自己用排列组合办法凑出wrong format 然后再输入到IDEA的terminal里,后来学会了用命令行(OS还是有点用)读入数据文件将运行结果重定向到新的文件然后 -diff 比较二者区别;

第二个单元多线程由于每次运行的结果都有可能不一样,而且自己的能力写一个测评机实在是不足,所以只对自己的程序进行较短的正确性测试,导致强测有一点超时;自此下定决心,要把程序写得尽可能完善,增强程序的鲁棒性。

第三个单元管理地铁图,数据格式都给定了,自己用python 写了一个数据生成器,黑箱测试,学会了用Junit进行单元测试,看到绿色的pass的时候心里还是很开心的;JML让代码规划没有二义,在工程设计上肯定是很有用处的,感觉我们离实际开发更近了一步;

第四个单元要写和考虑的东西非常多,所以我花了大量的时间在研究UML各种element的层次和查询要求上,结果也是好的,交中测的时候没有出现大家热议的mid5和weak5的bug,

测试文件是一个很重要的东西,有时候随机生成的数据不一定符合要求(尤其是第四单元),就要精心构造各种边界数据,但是只要把一个东西完全理解了,自然就会习惯性的处理各种极端问题(被我系培养的有点神经敏感)。

 

 

总结自己的课程收获

  • 学会了“自力更生”,明白了同学之间互相讨论的重要性

  • 初次接触多线程,觉得很有意思,《图解Java多线程设计模式》这本书寓教于乐,写得通俗易懂明白晓畅,还有点可爱。

  • 领略了工程化开发的一些工具,接触了一些建模工具(UML是语法明确、语义清晰的可视化语言。用符号来表示说明问题所冒的风险是显而易见的,所以,绘制或阅读UML意味着我们要以更加可视化的方式工作,开发我们的脑力,而不是迷失在UML语言的细节和工具中。

  • 真的实现了一周上千行代码,有小小的成就感

  • 决定回去好好复习和扩展数据结构的知识

 

PS:要大力表扬一下今年的OO课程改革,给了一些非常好用的接口,使得今年的OO不再是Wrong Format课,也没有某乎上一些用户喷得那么不堪。讨论区也是一个很友好的发言平台,有很多干货。

立足于自己的体会给课程提三个具体改进建议

  1. 老师讲课时能够再具象化一点,可以模仿《Head First Java》这本书的例子,把课程讲得生动形象,提高同学们上课出勤率和听课效率;研讨课优质内容互通。

  2. 这门课极大地培养了学生们的自己查阅资料的能力,但我还是希望指导书能对思路或算法有更清晰的描述,比如第三单元的时候对不同算法的权衡。还有数据范围(尤其是第四单元)应该给的再详细一点,也可以节省大家的时间也不会太麻烦老师。

  3. 我们会遵守DDL完成作业,若有完不成会承认是自己的锅,不捞人无可厚非,希望课程组在发放资料的时候也可以严格遵守ddl~笔芯~

Guess you like

Origin www.cnblogs.com/vanellopeblog/p/OOSummary.html