Question

Hi I am very new to web app development. I am creating a Java web app. Safe to assume that the web app will be used by multiple clients at the same time. Inside my app I wish to call a static method. It is a generic method and so there is no need to create an object just for that. Is there a processing penalty by doing that? Since method was declared static will there be only one method for all web clients to share? Will this be a bottle neck? What's the best practice regarding this? Thanks thanks.

Was it helpful?

Solution

If the static method is synchronised or has some form of thread locking, then it will be a bottleneck. But if it is thread-safe, then you should be fine.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top