I need to design a vending machine that dispenses various drinks like tea and coffee.
I am almost done with the design, but there is this one decision that I am not able to take.
About the Drink class.
Should I make a concrete Drink
Class with certain attributes and for every drink make a new instance and set the attributes accordingly.
Example:-
Drink tea = new Drink();
Drink coffee = new Drink();
or Another approach can be that I make an abstract Drink class.
abstract class Drink{ }
and make tea and coffee like
class Tea extends Drink{ }
class Coffee extends Drink { }
What are the pros and cons of both the approaches?