您最喜欢的 GWT MVP 框架是什么?

发布于 2024-10-06 12:12:06 字数 1431 浏览 0 评论 0原文

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(8

挽清梦 2024-10-13 12:12:06

目前这有点困难。 MVP 似乎是本月(或年度)的风潮,但可用的选项太多,而实际的教程却很少。

我浏览了“联系人”示例并有点明白了:
http://code.google.com/webtoolkit/articles/mvp-architecture.html

然后我意识到他们在 2.1 中添加了“活动”和“地点”,所以我查看了该示例:
http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html

还有许多框架,但如果可能的话,大多数人似乎想使用“谷歌方式”。我将提供 http://code.google.com/p/gwt-platform/ 尝试一下,因为它看起来有一些很棒的文档,而这正是谷歌目前所缺乏的。

关键是,没有好的教程 - 这就是我们真正理解的方式。关于 gwt 的 Stockwatcher 教程非常有用,我们可以做更多类似的事情。以下是我发现的一些花絮:

This is a bit of a difficult one at the moment. It seems MVP is the flavour of the month (or year, as it were) but there are so many options available and very few actual tutorials.

I went through the Contacts example and kinda got it:
http://code.google.com/webtoolkit/articles/mvp-architecture.html

Then I realised they had added Activities and Places in 2.1, so I looked at that example:
http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html

There are also numerous frameworks out there but most people seem to want to use "the google way" if possible. I'm going to give http://code.google.com/p/gwt-platform/ a go because it looks like it has some great docs, and that'[s what google is lacking at the moment.

The point is, there are no good TUTORIALS available - that's how we will all actually understand. The Stockwatcher tutorial on gwt was really useful, we could do with more like it. Here's some tidbits I've found:

<逆流佳人身旁 2024-10-13 12:12:06

我使用 GWTP 是因为它有相当完善的文档、易于理解并且拥有活跃的用户社区。当我开始学习这个框架时,我不得不在论坛上问几个问题,在这两种情况下,我在同一天都得到了一位作者友好且有帮助的答复。

I use GWTP because it is reasonably well documented, easy to understand and has an active user community. When I started learning the framework I had to ask a couple of questions in the forums and on both occasions, I got a friendly and helpful response on the same day from one of the authors.

哽咽笑 2024-10-13 12:12:06

我认为 MVP for GWT 的最佳技术是拥有以下类

  1. Model
  2. View
  3. Presenter

并让视图和 Presenter 通过定义的接口进行交互,并让 Presenter 从模型中获取数据。首先,它非常简单,其次它允许团队合作,因为我们使用接口,每个团队只需要遵守接口即可。

例如,

     1. Those working on the MODEL abide by the ServiceAync Interface

     2. Those working on the view creates the User Interface and returns the  
        specified control to the presenter according the program interface defined by
        their respective presenter
     3. And Finally those working on the presenter level defines an interface which
        the view has to implement

我认为其中可能出现的主要问题是当视图、模型或演示者之一不遵守接口时

I think the best technique of MVP for GWT is to have the following classes

  1. Model
  2. View
  3. Presenter

And make the view and the presenter interacts through a defined interface and have the presenter fetch data from the model. First, it is very simple, secondly it allows team working since we are using interfaces, every teams just have to abide by the interface.

For e.g.

     1. Those working on the MODEL abide by the ServiceAync Interface

     2. Those working on the view creates the User Interface and returns the  
        specified control to the presenter according the program interface defined by
        their respective presenter
     3. And Finally those working on the presenter level defines an interface which
        the view has to implement

I think that the main problem that can arise in this is when one part which may be one of the View,the Model or the Presenter doesn't abide by the interface

壹場煙雨 2024-10-13 12:12:06

新版本的 GWT (GWT 2.1) 引入了 MVP 框架,

他们引入了一些新术语,例如:

  1. Views
  2. ClientFactory
  3. Activity
  4. Places
  5. PlaceHistoryMapper
  6. ActivityMapper

您可以在此处查看详细信息:

http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html

The new version of GWT (GWT 2.1) introduced an MVP framework,

they introduced some new terminology like:

  1. Views
  2. ClientFactory
  3. Activities
  4. Places
  5. PlaceHistoryMapper
  6. ActivityMapper

you can check the details here:

http://code.google.com/webtoolkit/doc/latest/DevGuideMvpActivitiesAndPlaces.html

栩栩如生 2024-10-13 12:12:06

看起来 GWT 框架比比皆是,很像 Java Web 框架。话虽这么说,我选择了 4。主要是因为我想在没有样板接口的情况下实现 MVP:

http:// www.gwtmpv.org/view Generation.html

文档一如既往地简洁,但如果您有任何问题请联系我,我很乐意回答。

gwt-pectin 也很好——我认为 gwtmpv 更简洁,但是 gwt-pectin 已经做了丰富的模型/绑定到视图方法一段时间了。

Seems see GWT frameworks are a dime a dozen, much like Java web frameworks. That being said, I went with 4. Primarily because I wanted to do MVP without the boilerplate interfaces:

http://www.gwtmpv.org/viewgeneration.html

Docs are light, as always, but ping me if you have any questions, I'd be glad to answer them.

gwt-pectin is good too--I think gwtmpv is more succinct, but gwt-pectin has been doing the rich model/bound to a view approach for awhile.

放飞的风筝 2024-10-13 12:12:06

同样使用内置 MVP 框架,幸运的是,当使用 Spring Roo GWT 时,所有样板代码都会为您生成。

Also using the built-in MVP framework, luckily when using Spring Roo GWT, all that boilerplate code is generated for you.

葬花如无物 2024-10-13 12:12:06

对我来说,它是 GWTP,一个完整的模型-视图-呈现器框架,可以简化您的下一个 GWT 项目。可以在
http://code.google.com/p/gwt-platform/

For me its GWTP, a complete model-view-presenter framework to simplify your next GWT project. available at
http://code.google.com/p/gwt-platform/

单身狗的梦 2024-10-13 12:12:06

我尝试过 GWTP,但如果你不理解它,它并不能解决所有问题,而且很难偏离这种做事方式。我第一次尝试时遇到了这个问题,我也尝试了一遍。不幸的是,我也遇到了同样的问题。我想将演示者和视图合并到一页,因为这对于该页面来说是多余的。不幸的是,我不知道该怎么做,所以我决定我最担心的事情已经成为现实。很难改变他们在 GWTP 中的做事方式。 GWT 2.1 的架构更加解耦。我遇到问题ActivityMapper 不过。现在我正在看mvp4g。

I tried GWTP but it doesn't everything under the hood without you understanding it and it is hard to diverge from there way of doing things. I had this issue the first time I tried it and I tried it again too. Unfortunately, I had the same issue. I wanted to combine the Presenter and View for 1 page because it was overkill for that page. Unfortunately, I couldn't figure out how to do that so I decided that my worst fears had been realized. It's very hard to diverge from their way of doing things in GWTP. The architecture of GWT 2.1 is much more decoupled. I hadan issue with the ActivityMapper though. Now I'm looking at mvp4g.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文