I am currently building an API which will be used by a webservice.
I was wondering what performance issues I could meet if I built my API using a large amount of static methods.
The original idea was to build expert objects which act as services.
In a single user environment this approach was great! But I will soon need to port this to a multi/concurrent user environment.
What kind of performance issues might i encounter with this kind of architecture?
Best regards,
Edit:
The static methods hold no static variables and have no side effects. They simply execute a normal routine where everything is instantiated. (ie. vars and objects)
There’s no particular effect on concurrency. The same rules are true: mutating shared data concurrently is bad. If you have instance methods but they don’t mutate anything, you’re fine.
There’s a difference in general design though – static methods should almost always be thread-safe (i.e. you should make them thread-safe) whereas instance methods don’t generally have to be (although you should document your class’s thread-safety).