MVC的输入登录和Business Lgic之间的区别 [英] Difference between Input login and Business Lgic for MVC

查看:85
本文介绍了MVC的输入登录和Business Lgic之间的区别的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好,



我刚刚开始学习MVC,因为我要用不同的文章来清除MVC的基本概念我更加困惑为什么我们用这个?在每篇文章中都提到业务逻辑和输入逻辑在MVC中是不同的。任何人都可以通过Example告诉我什么是业务逻辑以及什么是输入逻辑。我想通过这个事情可以更清楚地了解MVC模式。



先谢谢!!!!!!



问候

Raman Agrawal

Hi all,

I have just started to learn MVC, as I am going different articles to clear the basic concept of MVC more I am getting confused that Why we use this ? In every article its mention that business logic and input logic are different in MVC. Can any one tell me what is business logic and what is input logic in detail with Example. I guess by this thing it will be more clear to under stand the MVC pattern.

Thanks in Advance!!!!!!

Regards
Raman Agrawal

推荐答案

在我看来,术语业务逻辑并不是一个精确的定义。 Evans在他的书领域驱动设计中谈到了两种类型的业务逻辑:



域逻辑。

应用程序逻辑。

这种分离在我看来更加清晰。并且认识到存在不同类型的业务规则也意识到它们并非都必须在同一个地方。



域逻辑是对应的逻辑到实际的域名。因此,如果您正在创建会计应用程序,那么域规则将是关于帐户,过帐,税收等的规则。在敏捷软件规划工具中,规则将类似于根据积压中的速度和故事点计算发布日期,



对于这两种类型的应用程序,CSV导入/导出可能是相关的,但CSV导入/导出的规则与实际域无关。这种逻辑是应用程序逻辑。



域逻辑肯定会进入模型层。该模型也将对应于DDD中的域层。



但是,应用程序逻辑不一定必须放在模型层中。这可以直接放在控制器中,或者您可以创建一个托管这些规则的单独应用程序层。在这种情况下最合乎逻辑的取决于实际应用。



来源 [ ^ ]



你也可以看看这个



A-Better-Understanding-Of- MVC-Model-View-Controller-Thanks-To-Steven-Neiland.htm [ ^ ]
The term business logic is in my opinion not a precise definition. Evans talks in his book, Domain Driven Design, about two types of business logic:

Domain logic.
Application logic.
This separation is in my opinion a lot clearer. And with the realization that there are different types of business rules also comes the realization that they don't all necessarily go the same place.

Domain logic is logic that corresponds to the actual domain. So if you are creating an accounting application, then domain rules would be rules regarding accounts, postings, taxation, etc. In an agile software planning tool, the rules would be stuff like calculating release dates based on velocity and story points in the backlog, etc.

For both these types of application, CSV import/export could be relevant, but the rules of CSV import/export has nothing to do with the actual domain. This kind of logic is application logic.

Domain logic most certainly goes into the model layer. The model would also correspond to the domain layer in DDD.

Application logic however does not necessarily have to be placed in the model layer. That could be placed in the controllers directly, or you could create a separate application layer hosting those rules. What is most logical in this case would depend on the actual application.

Source[^]

and also you can have a look at this

A-Better-Understanding-Of-MVC-Model-View-Controller-Thanks-To-Steven-Neiland.htm[^]


这篇关于MVC的输入登录和Business Lgic之间的区别的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆