A filling station (gas station) is to be set up for fully automated operation. D
ID: 3817904 • Letter: A
Question
A filling station (gas station) is to be set up for fully automated operation. Drivers swipe their credit card through a reader connected to the pump; the card is verified by communication with a credit company computer, and a fuel limit is established. The driver may then take the fuel required. When fuel delivery is complete and the pump hose is returned to its holster, the driver’s credit card account is debited with the cost of the fuel taken. The credit card is returned after debiting. If the card is invalid, the pump returns it before fuel is dispensed.
Your task is to determine what design pattern(s) is/are to be applied in the system(Decorator, Factory Method, Strategy, Singleton, Adapter, Facade, Template Method, Iterator, Observer, Command, Builder, Chain of Responsibility, Memento, Visitor, State, Flyweight, Mediator, Prototype, Proxy.). Explain your choice(s) clearly.
Explanation / Answer
Gas Filling Station has pumps. Pumps have credit card readers. Driver can able to swipe their cards, pumps have Fuel. Pumps card readers communicate with Credit Company. Driver interacts with pump for fuel and credit card.
In this situation the following we need to treat as objects.
They are Pump, Card reader, Fuel tank, communication system, system controller and price table.
Design pattern for the following system is
Object
Attributes
Operations
Pump
Fuel dispensed
Price
Hose status
Trigger status
Fuel type
Activate
Deactivate
Deliver fuel
Stock update
Card reader
Card number
Card type
Card status
Credit limit
Read card
Check status
Print receipt
Communication system
Number dialed
Credit limit
Send card number
Return card status
System controller
Card number
Card type
Max delivery
Price table
Fuel delivered
Price table
Fuel prices
Lookup
Amend price
Object
Attributes
Operations
Pump
Fuel dispensed
Price
Hose status
Trigger status
Fuel type
Activate
Deactivate
Deliver fuel
Stock update
Card reader
Card number
Card type
Card status
Credit limit
Read card
Check status
Print receipt
Communication system
Number dialed
Credit limit
Send card number
Return card status
System controller
Card number
Card type
Max delivery
Price table
Fuel delivered
Price table
Fuel prices
Lookup
Amend price
Related Questions
drjack9650@gmail.com
Navigate
Integrity-first tutoring: explanations and feedback only — we do not complete graded work. Learn more.