Java interface static method workaround?

后端 未结 4 1407
我寻月下人不归
我寻月下人不归 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:12

    Stateless doesn't mean static. Stateless means that the component doesn't rely on state. I say component, because the whole implementation of your interface is actually stateless - it will not have any member variables. So multiple instances of the implementation classes are perfectly OK. Especially if you have a context to manage them - Spring or EJB for example.

提交回复
热议问题