design pattern
-
I have faced this question in an interview, Design algorithm for elevators using any design pattern. please guide me regarding this. krishna
Well I can give a brief description :-D When they go up they keep going up processing the requests on the way. and When they come down they keep coming down processing the requests on the way. They don't change direction in between unless they have processed all requests in that direction and BTW if anybody gives another request before it changes direction it processes that too. This is called the elevator algorithm. :-D
Nibu thomas Software Developer
-
Well I can give a brief description :-D When they go up they keep going up processing the requests on the way. and When they come down they keep coming down processing the requests on the way. They don't change direction in between unless they have processed all requests in that direction and BTW if anybody gives another request before it changes direction it processes that too. This is called the elevator algorithm. :-D
Nibu thomas Software Developer
-
hai, can u elaborate this , just like what r the abstract base class we r designing for this and derived classes and some importnt methods.
Composite Pattern - For the structure, components and movement of the elevator (e.g. doors, switches, lightsource etc.). Iterator Pattern - For the list of floors. Observer Pattern - To identify on which floor to stop. Rahim Rattani Software Engineer, Matrix Systems (Pvt) Ltd., Karachi - Pakistan