什么时候在 Spring MVC 之上使用 Spring WebFlow 才有意义?
Spring MVC 已成为构建企业 Web 应用程序的非常流行的框架。任何复杂的 Web 应用程序都有某些需要编码的流程,包括一些条件流程(即,如果信用卡信息正确,则显示已处理的订单,如果输入不正确,则显示验证错误)。
什么时候在 Spring MVC 之上使用 Spring WebFlow 才有意义?关于使用 Spring WebFlow 的决策过程应该是什么?
Spring MVC has become a very popular framework for building enterprise web applications. Any complex web application has certain flows that need to be coded, including some conditional flows (i.e., show order processed if the credit card information was correct, or validation errors if something was not entered correctly).
When does it make sense to use Spring WebFlow on top of Spring MVC? What should be the decision making process regarding using Spring WebFlow?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
如果您有一个具有某些应用程序流程的 Web 应用程序。例如,如果您有某种注册流程,一个按钮可以转到一个页面,而另一个按钮可以转到另一个页面。 Spring Webflow 可以很好地处理到不同流程集的转换。
基本上,如果应用程序的某些部分是链接的并且页面在执行过程中相互依赖,则最好使用 SWF。
If you have a web application that has some application process. For example, if you have some kind of sign up process that one button can go to one page while another can go to a different page. Spring Webflow can handle transitioning to different sets of processes very well.
Basically, if some part of your application is linked and pages depend on each other during the course of an execution SWF is good to use.
我个人最喜欢 webflow 的两点:
我不喜欢的是新版本的不一致和向后兼容性差。例如,最新的 webflow 2.1 与 JSF 1.x jira 不兼容。与 Spring Security 集成也存在许多问题。例如,在 spring security 3.x 中,他们只是更改了一些包名称
一般来说,正如 Sasi 提到的,webflow 几乎会迫使你将逻辑分离在不同的 webflow 中 - 我认为这很好。
What I personally like in webflow most are 2 things:
What I don't like is inconsistency and poor backward compatibility of newer versions. For example, latest webflow 2.1 is not compatible with JSF 1.x jira. There are also numerous problems with integrating with Spring Security. For example, in spring security 3.x they just changed some package names
In general, as Sasi mentioned, webflow will almost force you separate your logic in different webflows - and this is nice I think.
Webflow 有效解决的一个问题是,它将业务逻辑与控制逻辑完全分离(或者至少很难混合)。
同意 @John 关于用例的观点,但我想指出,一旦您开始大量使用 webflow,您会发现自己编写了大量 xml 文件(因为在 webflow 中您指定了 xml 文件中的所有流)。这对我个人来说几乎是一个交易破坏者。
One problem that webflow solves efficiently is it cleanly separates (or at least it makes very hard to mix) business logic from your control logic.
Agree with @John on the use cases but I would like to point out that once you start using webflow heavily, you will find yourself writing a lot of xml files (since in webflow you specify all the flows in xml files). This is almost a deal breaker for me personally.
我用过MVC和SWF。就我个人而言,我更喜欢 SWF 而不是 MVC,因为以下两个坚实的原因:
I have used MVC and SWF. Personally I prefer SWF over MVC due to the following two solid reasons: