There were 6 Lifts serves in a 10 Floor Multistorey Apartment.
Main Objectives are as follows
Waiting Time of the persons in each floor should be minimized
If the Lift is full, then it should stop any of the floors eventhough if anyone press the outside button from any of the floor. It should directly reach the destination.
Lift should work in a way it should use minimal electricity
Travelling hours of the persons should be minimized. It should follow some methodology where the travelling hours of the persons in the lift is minimized.
We need to develop an application design for this Business Scenario. Which design pattern is suitable for this scenario ?
Loading

Max CervantesPosted May 20, 2011, 11:49 AM
Design patterns are just guides to help you create a better OO design.
The first thing you should do, is create a design, a model that conforms to your requirements. U gotta identify the actors, and the way they interact with each other. I tend to use any of the UML dynamic diagrams. As you evolve your model, patterns will emerge. And when u get stock with something that don't 'feel' good in your model, then u can check for a design pattern that helps you out. Or you can ask about that specific. But not before that. Ur gotta do your homework first ;)
Jean Paul's it's a good idea. First list the scenarios. And proceed from there. Look out for the domain rules. The better ur understanding of the rules, the clearer and readable your model will be.
Jean PaulPosted Jan 13, 2011, 9:48 AM
For example the following scenarios are there:
Lift is on Floor 2 and Passenger on Floor 1 requests Lift - We need to get the closest matched lift which is not full
The Passenger again requests the lift from Floor 1 - Now Floor queue need to be checked
I would prefer two classes namely Lift and LiftManager. I remember Veto pattern can do something with Lift availability.
I am eager to see the solutions what others prefer: