I am writing an ordering system.
In this program, the user can request food. For this purpose I have a class named User
and a class named Food
.
In the class Program
I have a field which is a list field that contains foods object. In the class Program
I also have a field of user object.
Now I am a bit confused. The thing is if two users at the same time request order, do I need to use a list of users in my Program
class or is the one field enough? Or do I need to use threading.
The way I have written the app, it just handles one request at the time. So what about further requests? What changes do I need to apply so it handles users' requests?
I am not using any database at the moment (which I am not that much familiar with)
class User {
private string name;
private string address;
// ...
}
class Food {
private string name;
private int id;
// ...
}
class Program {
private User user;
private List<Food> foods;
// ...
}