I think you can get some idea from MVC pattern.

redriver (redriver)
Class1 is represent the state of elevator and implement obserable interface. Class2 is a Viewer and Controller responsible for display and control elevator implement observor interface. so the system is more clear.

2002-2-21 -04:00

回到话题: 请问各位大虾:我在用JAVA编一个电梯控制系统,以CLASS1负责各个电梯的运行,以CLASS2控制中心调度,可如何让CLASS2随时知道各个电梯的运行状态(FLOOR,DIRECTION,MOVE OR STOP)呢?多谢!

回到论坛: HOME枫下论坛枫下论坛主坛工作学习IT技术讨论