Standard conventions or good practices when naming local/remote interfaces of EJBs?

拟墨画扇 提交于 2019-12-23 10:56:46

问题


Are there any conventions or good practices when naming interfaces for EJBs? I am trying to apply some DDD principles in my application as well so I am using the "service" sterotype on the classes that is the interface for the world outside.

If I have a QuestionService EJB that provides business logic operations to clients, what would the @Local/@Remote Interface be named? All the books I read so far only names them QuestionServiceLocal/QuestionServiceRemote. Is this suffcient (I am not trying to get fancy with naming, but I wonder if there are better naming conventions)?

Also, are the other/better ways of naming the "services" in an application than just adding the "...Service" suffix on each class?


回答1:


Java naming conventions are created and adopted by the community and also by the elder developers in the company.
So every time we are facing naming issues, we can go forward with the following:

  1. if the project is already there then just follow the project naming coventions
  2. if this is a new project you're creating then:
    a. QuestionServiceLocal/QuestionServiceRemote is a very good approach
    b. QuestionService is more than enough for naming a service


来源:https://stackoverflow.com/questions/10065065/standard-conventions-or-good-practices-when-naming-local-remote-interfaces-of-ej

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!