码迷,mamicode.com
首页 > 其他好文 > 详细

Peer Programming Project: 4 Elevators Scheduler

时间:2014-10-16 02:36:31      阅读:190      评论:0      收藏:0      [点我收藏+]

标签:des   style   io   os   使用   ar   for   strong   sp   

1.Advantages and disanvantages of Peer Programming

  advantages

The code are constantly validated by two people, reducing the possibility of indivudual making stupid mistakes.

    • The code belongs to two people simutaneously, avoiding consulting each other some trivial problem, such as variable definition, occuring too frequently. To some extent, this also abbandoned individualism.
    • Under the supervisoion of your partener, we tend to resolve the tasks from within. The more concentrated, the more efficient. We kind of like one statement about peer programming: While sit besides your partener, the keyboard that lies beneath your hands turns into a piano. It is not you programming a front of your teammate, but performing a pleasing symphony in front of your audience. Wholeheartedly, Peer Programming is really a creative and interesting ways of programming.
    • share experiences and knowledges
  •   Disadvantages
      • need time to get to know each other for better cooperation. May feel uncomfortable at the beginning.
      • Not every situation suit this method.
      • The experienced may become frustrated about fresh-man. The fresh-man, in contrast, may feel too nervous to perform well.
      还有一些在网上看到的,感觉都是会遇到的问题:
        •   喜欢发号施令的人总是对敲键盘的人说:“到末行,加个反括号,然后…”。他不去关注解决方法和下一步该怎么做,而过度关注一些编程细节。
        •   拼写纠错者坐在你旁边,纠正你输入的每个错误字符。当然,他没有时间来真正的进行导航。
        •   深藏不露者仅仅自己敲着代码而不告诉别人他在做什么。领航员不得不靠自己去弄懂代码。关于该用什么方法,该选择哪种设计,领航员和实施者之间完全没有交流。
        •   跳跃很大的人喜欢在代码中进行大范围的跳跃,这样领航员不知道进行到哪里了。
  •   In brief, one should contemplate before conducting peer programming. All in all, just like the <Peopleware> said, human is always the one that we should consider first.

2.Hiding Information,interface design,loose coupling

 

 

 

3.Design By Contract

  调用者必须提供正确的参数,被调用者必须保证正确的结果和调用者要求的不变性。

  •   优点: 双方都有必须履行的义务,也有使用的权利,这样就保证了双方代码的质量,提高了软件工程的效率和质量。
  •   缺点
    • 契约式编程需要一种机制来验证契约的成立与否。但是并不是所有的程序语言都有断言机制。那么强行使用语言进行模仿就势必造成代码的冗余和不可读性的提高。比如.NET4.0以前就没有assert的概念,只在4.0后全面引入了契约式编程的概念。
    • 契约式编程并未被标准化,因此项目之间的定义和修改各不一样,给代码造成很大混乱。

5.unit test

5.UML

 

6.算法实现:

  Scheduler:修改scheduler,放弃了StopatEachFloor,使用了新的方法Allocate。

  Passenger:增加了接口中的属性

  Elevator:增加了接口中的属性

 

Peer Programming Project: 4 Elevators Scheduler

标签:des   style   io   os   使用   ar   for   strong   sp   

原文地址:http://www.cnblogs.com/dahuang/p/4027771.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!