业务级对象应该如何命名?
我们正在构建一个面向服务的系统,我们将应用程序分为几个层:
- SOAP Web 服务(例如 BuildingService.asmx)
- 业务逻辑层(例如 BuildingXXX)
- 数据访问层(例如 BuildingProvider)
- 类型(例如 Building)
SOAP Web 服务只是从业务逻辑层实例化 BuildingXXX 类型的对象,以便将实现排除在 SOAP Web 服务之外。 BuildingXXX 然后使用数据访问层中的 BuildingProvider 返回数据传输对象层中定义的类型。
我们一直无法确定应该如何称呼业务逻辑层中的对象。
命名这些业务级实体的“标准”命名约定是什么?
We are building a service-oriented system where we have separated the application into several layers:
- SOAP web services (e.g., BuildingService.asmx)
- Business logic layer (e.g., BuildingXXX)
- Data Access layer (e.g, BuildingProvider)
- Types (e.g., Building)
The SOAP web services simply instantiate an object of type BuildingXXX from the business logic layer in order to keep the implementation out of the SOAP web services. BuildingXXX then uses the BuildingProvider from the data access layer to return types defined in the data transfer object layer.
We have been unable to determine what we should call the objects in the business logic layer.
What is the "standard" naming convention for naming these business level entities?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
就我个人而言,我会将业务逻辑层服务称为“BuildingService”,然后将 Web 服务称为“BuildingWebService”。
或者,您始终可以使用通用的“BuildingManager”以及服务层。
Personally, I would call your business logic layer services "BuildingService" then call the web services "BuildingWebService".
Or you could always go with the generic "BuildingManager" as well for the service layer..
命名空间是你的朋友。 BusinessLayer.Building、BusinessLayer.Facility 怎么样? 使用 DataLayer.Building、DataLayer.Facility 等。您可以按事物的本来面目称呼事物,但它们可以是不同的事物。
Namespaces are your friends. How about BusinessLayer.Building, BusinessLayer.Facility? Use DataLayer.Building, DataLayer.Facility, etc. You get to call things what they are, yet they get to be different things.
我会天真地使用 BuildingRules(因为这就是它们,对吧?),但我实际上不知道约定是什么......
I would naively go with BuildingRules (since this is what they are, right?) but then I don't actually know what are the conventions...
我更喜欢前缀而不是后缀,以便相关层一起排序,例如
i prefer prefixes instead of suffixes, so that the related layers sort together, e.g.