dimanche 23 février 2020

How to design object oriented classes representing devices that accept different inputs and outputs?

I'm having trouble finding an optimal object oriented design for the following scenario:

Create an object oriented design for different types of smart devices. Different devices may have different inputs (typing and/or voice), outputs (sound and/or display), and power types (battery or plugged-in). Your design should be able to handle different input and respond to the correct output when asked about its battery status. (e.g.: "50% charged" or "plugged in").

Any ideas on what class hierarchy might be good for this scenario? Any design patterns that are applicable?

Aucun commentaire:

Enregistrer un commentaire