与 Yii 等 php 框架相比,使用 GWT 有何优势
我即将开始开发一个私人 TODO 网站(稍后将扩展到 Web 应用程序)。我不确定使用什么框架。我读过有关 GWT 和 PHP 框架(例如 Yii)的内容。每个人比另一个人有什么优势。
背景 - Java经验 - 拥有支持 php 的 apache Web 主机
疑问:
- 在 GWT 中开发是否意味着重构会比在 PHP 中开发更容易(特别是因为您可以使用 Eclipse),
- 一旦您创建数据库布局,似乎 PHP 框架(例如 Yii 设计对象)会为您提供帮助。 ..这可以用 GWT 来完成吗?
谢谢!
I am about to start developing a private TODO website (that later will be extended to Web applications). I am unsure what framework to use. I have read about GWT and PHP frameworks such as Yii. What advantages do each one have over another.
Background
- experience in Java
- got an apache web host that supports php
Doubts:
- Would developing in GWT mean that refactoring would be easier than developing in PHP (especially since you can use Eclipse)
- seems like PHP frameworks such as Yii design objects for you once you create database layout ... can this be done with GWT?
Thanks!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在问题或答案/评论中没有看到提到的一个很大的区别是 Yii 是一个服务器端框架,它完全在您自己的/托管的服务器上运行,而 GWT 编译为 JavaScript,因此在客户端的浏览器中运行仅有的。这两种产品(和想法)服务于截然不同的目的,并且可以一起使用。
当使用 GWT 构建客户端时,可以使用任何所需的工具构建服务器,只要它向基于 JS 的客户端公开数据即可。它可以采用 JSON 或 XML 的形式,也可以采用其他一些数据编码的形式(例如,GWT 内置于 RPC,可以将复杂的对象图传入和传出 Java servlet 容器)。
如果您将它们一起使用,Yii 可以用于从数据库模式/布局创建 PHP 对象,并构建各种身份验证/授权规则,以便客户端可以读取和写入数据。然后可以使用 GWT 构建一个读取和更新该数据的客户端,从而调用由 Yii/PHP 代码公开的服务。
One big difference I haven't seen mentioned in the question or answers/comments is that Yii is a server-side framework, which runs entirely on your own/hosted server, whereas GWT compiles to JavaScript, and is therefore runs in the client's browser only. These two offerings (and ideas) serve very different purposes, and can be used together.
When using GWT to build the client, the server can be built using any tool desired, so long as it exposes data to the JS-based client. That can be in the form of JSON or XML, or some other data encoding (GWT's built in RPC, for example, can pass complex object graphs to and from a Java servlet container).
If you were to use them together, Yii could be used to create PHP objects from the database schema/layout, and to build the various rules for authentication/authorization so the client can read and write data. GWT could then be used to build a client which reads and updates that data, making calls to services exposed by Yii/PHP code.
如果您喜欢 Eclipse,那么您当然可以继续使用 Eclipse 并继续使用 PHP 进行开发。 eclipse.org 的 PHP 工具非常好,Aptana 的 IDE 插件甚至更好。
关于 Yii 与 GWT,这实际上取决于您选择的语言。如果您非常精通 Java 并且非常喜欢 Java 语言的强类型,那么 GWT 是一个不错的选择(尽管当然还有其他选择可以让您留在 Java 世界,例如 Tapestry)。 PHP 框架在采用 OOP 和概念(例如基于数据库创建业务对象)的程度方面差异很大。由于内置的代码生成功能,Yii 作为一个框架绝对脱颖而出。如果您开始使用 PHP,这肯定会对您有所帮助。
If you like Eclipse you can certainly stay with Eclipse and still develop in PHP. The PHP tools from eclipse.org are very good and the IDE plugin from Aptana is even better.
Regarding Yii vs GWT, it really depends on your language of choice. If you are highly proficient in Java and really like the strong typing of the Java language then GWT is a good choice (although there are certainly other choices that keep you in the Java world such as Tapestry). PHP frameworks vary quite widely in how much they embrace OOP and concepts such as creating your business objects based on your database. Yii definitely stands out as a framework due to the code generation capabilities built in. That will definitely help you if you're getting started with PHP.