摘要:
【附加题】由结对编程想到的——关于电梯调度Interface的改进关于用户外请求的处理我们知道,用户对一个电梯的请求分为两种:内请求(Destination Request)与外请求(Direction Request),在Real Scenario中,对同一层的内请求与外请求大多数情况下只会发生一次,比如,有5个人在一层等上行电梯,他们之中只会有一个人(很可能是最先到的那个)按上行请求的按钮,其他人看到按钮亮后,就不会再按了。同样,同一楼层的内请求也很可能只有一次,即使有多个人要到这个楼层。而测试程序认为每个Passenger都要向Scheduler提交请求,这样,Scheduler就能够判 阅读全文
摘要:
由结对编程想到的——关于Information Hiding,interface design, loose coupling关于Information HidingInformation hiding is part of the foundation of both structured design and object-oriented design. In structured design, the notion of “black boxes” comes from information hiding. In object-oriented design, it gives r 阅读全文