I’m designing a WCF webservice that will potentially get called by 10,000+ plus separate clients at any given time. When the service gets called the service creates “Object1” class.
public List<string> AnswerClient() {
Object1 _hello = new Object1();
return _hello.AnswerClient();
}
Because the Object1 class needs to create other Object1 classes inside of it. It needs to create other subset Object1 classes. I was thinking of using static method in the Object1 class to create the other Object1 methods like
Object1.AnswerClient()
because I don’t think I need to create a specific Object1() in the first place. If multiple clients call the service, will this Object1.AnswerClient() mess up the code because it is static? Because statics are specific to the class, all the clients seem to be affected?
How should I design this class. Client calls service, service creates object based on client data. That object inside of it creates like 20 more similar objects (splits the user data depending on the data).
Any help and insight would help. How should I design this generally speaking?
Thanks.
I would suggest you to look towards Factory design pattern to do what you described above.