I am writing an order system.
In this program, the user can request power. For this, I have a class with a name Userand a class with a name Food.
In the class Program, I have a field that is a list field containing a product object. In the class Program, I also have a custom object field.
Now I'm a little confused. The fact is that if two users order a request at the same time, do I need to use the list of users in the class, Programor is one field enough? Or I need to use streams.
As I wrote the application, it just processes one request at a time. So what about further queries? What changes do I need to apply to handle user requests?
I do not use any database at the moment (which I am not very 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;
}
source
share