Crazenezz
Crazenezz

Reputation: 3456

Singleton in web service

I create my own library to draw something...

I make a play project and set it as a web service server and call my library to provide user an image as the return value.

What I want to ask is, should I make a Singleton class to access the library or not? Why?

Thanks for your help...

Upvotes: 1

Views: 393

Answers (1)

Codemwnci
Codemwnci

Reputation: 54914

Your Play Web Service action is a static method, so effectively your controller code is already a single executable piece of code. If you are accessing your library from your controller code (which I think you are based on your previous questions), then a Singleton is not going to make any difference apart from adding unneccessary code to your application.

Upvotes: 2

Related Questions