Note: I feel obligated to mention that this is a homework question.
You’re the lead developer for a company that has cornered the market on high-way tollbooths. Your company produces simple booths where a vehicle drives up, the driver hands money to the toll taker who records a transaction and gives change. But there is so much more to the tollbooth industry. Some tollbooths have gates that open and close automatically, or are opened and closed manually by the toll taker. There are different types of gate controllers; some that come with gates that open and close automatically (with or without a timer—some use motion sensors and obstruction sensors to determine when to close the gate). Some gate controllers allow different types of gates to be connected. On top of this, there is no standard for how the software for the gates, or any other components in the system work. That is, there is no standard interface for them. The road systems for your customers have their own way of collecting tolls. Some will allow cash to be used and inserted into a coin collector. Some allow credit cards. Some issue tickets when you enter the road system and then you pay the toll when you exit. Today, automated payment systems like E-Z Pass are used on most toll roads, but not all. The company sees the sales of tollbooths booming and wants a software system that can handle all of the possible variability that exists today and in the future without a lot of rewriting code. This has been given to you as the lead developer/architect in the company.
I need to describe a general design for a system that will handle the different types of tollbooths and their components. I know that there are different types of gates, payment mechanisms, some sensors, and other things that are mentioned above. I'm also trying to account for variations that the customer can make when ordering their tollbooths from "this company". I'm having trouble starting creating a UML class diagram that shows the key components and how they relate to each other. I think the adapter pattern is a good choice for this? Does that sound right?
I've created the basic starting classes like Client, Tollbooth, and Gate. And I know the Client knows about the Tollbooth and the Tollbooth knows about the Gate, but I'm just unsure how to proceed when it comes to interfaces and specific methods.
Aucun commentaire:
Enregistrer un commentaire