本文介绍了最佳设计业务领域:将模型与逻辑分开?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是设计业务逻辑领域的新手,我正在寻找最佳设计.

什么是设计业务逻辑基础的更好方法:
1.将业务逻辑放入业务实体中.
2.具有静态模型,并通过使用适配器执行业务逻辑.

请参见下面的示例.

有什么更好的做法,什么是利弊?任何建议将不胜感激!

设计1

I''m new to designing a business logic layar and I''m searching for the optimal design.

What is a better way for the design of the business logic layar:
1. Put the business logic within the business entities.
2. Have a static model and perform de business logic by making use of adapters.

See the examples below.

What is better to do and what are de pro''s and cons? Any advise would be greatly appreciated!

Design 1

Dim Customer as New Customer(1)

Customer.Load()
Customer.Name = "John"
Customer.Update()



设计2



Design 2

Dim CustomerAdapter As New CustomerAdapter
Dim Customer As New Customer

Customer = CustomerAdapter.GetCustomerByID(1)
Customer.Name = "John"
Customer.Update

推荐答案


这篇关于最佳设计业务领域:将模型与逻辑分开?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

06-27 02:47