命名EJB的本地/远程接口时的标准约定或良好做法? [英] Standard conventions or good practices when naming local/remote interfaces of EJBs?
问题描述
命名EJB接口时是否有任何约定或良好做法?我也在尝试在应用程序中应用一些DDD原理,因此我在类(即外部世界的接口)上使用服务构造型。
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.
如果我有一个QuestionService EJB,它为客户端提供业务逻辑操作,@ Local / @ Remote接口的名称是什么?到目前为止,我读过的所有书都只将它们命名为QuestionServiceLocal / QuestionServiceRemote。这样就足够了(我不是想去看名字,而是想知道是否有更好的命名约定)?
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)?
另外,还有其他/更好的命名方式吗?应用程序中的服务,而不只是在每个类上添加 ... Service后缀?
Also, are the other/better ways of naming the "services" in an application than just adding the "...Service" suffix on each class?
推荐答案
Java命名约定是由社区以及公司中的资深开发人员创建和采用的。
因此,每次遇到命名问题时,我们都可以执行以下操作:
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:
- 如果该项目已经存在,则只需按照该项目命名
coventions - 如果这是一个新项目,然后创建:
a。QuestionServiceLocal
/QuestionServiceRemote
是一种非常好的方法
b。QuestionService
足以命名服务
- if the project is already there then just follow the project naming coventions
- 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
这篇关于命名EJB的本地/远程接口时的标准约定或良好做法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!