Java interface static method workaround?

后端 未结 4 1408
我寻月下人不归
我寻月下人不归 2021-01-20 17:09

We have a given REST interface:

POST /calculation
abc

This calculation can be implemented by different logical \"c

4条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-01-20 18:05

    Why do you think the methods should be static? They surely could be, but that would limit you in terms of plugging in a different implementation later. If you are concerned about memory consumption or the like, using a Singleton would do the same as static for you, as you already said in the last paragraph of your question.

提交回复
热议问题