you must have "FLOOR ,DIRECTION, status" attribute in your elevator class, then getXXX();in my opinion, class2 needn't know these information, just tell class1 to do what. class1 determine it.
-macsym(日进斗斤);
2002-2-21(#375668@0)
if class2 can directely control the elevator, why you need the class1?
-macsym(日进斗斤);
2002-2-21(#375734@0)
In opinion, class2 just forward the request and get result. class1 to prosess the request.
-macsym(日进斗斤);
2002-2-21(#375737@0)
Thank you,macsym,i understand CLASS1 just forword the REQUEST to CLASS1 to let CLASS1 to process, but what you mean "get result" here?
-lxz(flyer);
2002-2-21(#375754@0)
like "success, fail, true , false". just like you bushed the button, the light turn on.
-macsym(日进斗斤);
2002-2-21(#375762@0)
yeah, class1 must be muliti-thread
-macsym(日进斗斤);
2002-2-21(#375747@0)
you are so warm-hearted,macsym.another question: do you think three classes is enough for this system(CLASS1, CLASS2 plus another class for adminstrator)?
-lxz(flyer);
2002-2-21(#375774@0)
plus elevator class
-macsym(日进斗斤);
2002-2-21(#375777@0)
but i think CLASS2 is controller and CLASS1 is elevator, or maybe i should be a scheduler? the "elevator class" you mentioned here should include what kind of attributes and methods?
-lxz(flyer);
2002-2-21(#375786@0)
my picture: elevator class, administrator class(muliti-thread), client class(to response and forward request).
-macsym(日进斗斤);
2002-2-21(#375796@0)
forgot it, it's wrong. let me think it
-macsym(日进斗斤);
2002-2-21(#375801@0)
there are two kinds of request, one is outside elevators, the other is inside each elevator, should i combine these two requests inot one class? look forword to your reply.
-lxz(flyer);
2002-2-21(#375811@0)
no, that's diffirent .
-macsym(日进斗斤);
2002-2-21(#375818@0)
so maybe i can use the controller class i mentioned above to respond the outside requests and add a elevator class you mentioned before to deal with inside requests and forowrd them to scheduler class?
-lxz(flyer);
2002-2-21(#375826@0)
you are right!
-macsym(日进斗斤);
2002-2-21(#375813@0)
? i am confused. at what point i am right?
-lxz(flyer);
2002-2-21(#375821@0)
I need more detail about it, do you have a description about it?
-macsym(日进斗斤);
2002-2-21(#375853@0)
here is the description:
-lxz(flyer);
2002-2-21{669}(#375968@0)
this is the elevator control system for 15 floor building with 4 elevators. it runs just like normal elevators system in our real world. My system should provide an outside panel for user to require the UP/DOWN at any floor and also an inside panel to allow user in the elevators to select which floor he head to. The system should move UP/DOWN and STOP at any floor according to boht outside and inside requests. If without response for a outside request within 3 minutes there would be an alarm . Also an administrator paned is needed to control the whole system to stop and restart. My system also need to simulate the movement of the 4 elevators. Is that clear ?
hi, macsym. busy or just mad at my stupid question? anyway, thank for your help and would appreciate your further reply.
-lxz(flyer);
2002-2-21(#375887@0)
CLASS2 is controller and CLASS1 is elevator,
-macsym(日进斗斤);
2002-2-21(#375862@0)
hi, macsym, where are you, away. offline, busy, or just mad at my stupid question? anyway, thank fou your help and also wait for your futher reply.
-lxz(flyer);
2002-2-21(#375881@0)
CLASS2 is controller and CLASS1 is elevator(maybe thread or threadGroup)
-macsym(日进斗斤);
2002-2-21(#375901@0)
"maybe thread or threadGroup"? so you mean i even don't need thread? and also, only these 2 class is enough?
-lxz(flyer);
2002-2-21(#375974@0)
I think you can get some idea from MVC pattern.
-redriver(redriver);
2002-2-21{214}(#375920@0)
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.
do i have to learn MVC pattern? to design the whole system, write related documents(such as SDD) for submmission, and learn java already almost exaust me.
-lxz(flyer);
2002-2-21(#375989@0)