Right now I try to start getting on designing the class diagram as well on what methods needed to develop a simple food delivery app based on object oriented concept. However I am not familiar at all with how to code mobile app in a well build object oriented way. I am confused especially with the situation stated below:
In food delivery app, Customer class has a method named createOrder() so that Customer object able to make food order. The picture shows an example of food cart with food selected together with a “Place order” button.
If the button is used to create a new order, do I only require to create one createOrder method within the activity class of the food cart and remove createOrder method of the Customer class (Button click triggers createOrder() in food cart activity class, all code needed to create order is within createOrder() in the activity class)
the app needs both createOrder method in activity class of the food cart and Customer class
(Button click triggers createOrder() in food cart activity class, after that createOrder() in the activity class will call createOrder method in Customer class)
(all code needed to create order is within createOrder() of Customer class instead of activity class, createOrder() in activity class only contains a method call to Customer class createOrder() method)