每个函数/表单或表单组的边界类
我看到一些给出边界类的例子,比如 LoginForm 等。乍一看,这听起来是正确的。但在真实的应用程序中,每个模型/实体都有 CRUD(至少 4 个函数),将单个实体的所有函数分组为 1 个类是否更正确?
例如。
<<Boundary>>
TransactionForms
================
+ insertTransaction(...)
+ updateTransaction(...)
+ deleteTransaction(...)
+ listTransactions()
I saw some examples giving boundary class like LoginForm etc. That sounds correct at first glance. But in a real app where I have CRUD (4 functions at min) for each Model/Entity, isit more correct to group all functions for a single entity into 1 class?
eg.
<<Boundary>>
TransactionForms
================
+ insertTransaction(...)
+ updateTransaction(...)
+ deleteTransaction(...)
+ listTransactions()
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
对于边界对象来说,最好有像下面这样的东西,
在内部,这些方法利用事务服务来更新持久层。
It would be better to have something like below for boundary objects,
Internally, those methods make use of Transaction service to update persistent layer.