PHP是创建Web应用程序的最佳方式吗? [英] Is PHP the best way to create a web application?

查看:45
本文介绍了PHP是创建Web应用程序的最佳方式吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

PHP,并且在较小程度上JSF已经成为构建web

应用程序的非常流行的方式。我不明白,以及我希望你们所有人能够评论这些方法是如何构建网络应用程序的最好方法。

我来了来自传统的Struts / JAVA世界和传统的MVC

archetecture。在我看来,我可能是错的,PHP和JSF似乎将更多的业务和数据层代码提升到View Layer。我不知道这是多么好的事情。使用传统的

方法并将代码保留在视图之外不是更好吗?如何维护代码?它将分散在Web源代码(PHP页面等)上......耦合

似乎真的很高,而且不可能是重新计算的好处..


有人能让我知道我错在哪里吗?

PHP, and to a lesser degree JSF has become very popular ways to build web
applications. What I don''t understand, and what I would like you all to
comment on, is how these methods are the best way to build web applications.
I come from the traditional Struts/JAVA world and the traditional MVC
archetecture. It seems to me, and I could be wrong, that PHP and JSF seem to
be pulling more business and data layer code up to the View Layer. I don''t
see how this is a good thing. Wouldn''t it be better to use the traditional
method and keep the code out of the view? How does one maintain the code? It
will be scattered across web source code (PHP pages, etc.)... The coupling
would seem to be really high and that can''t be a good thing for reusue..

Can someone give me an idea of where I am wrong?

推荐答案

Hello neodem,
Hello neodem,
PHP,在较小程度上,JSF已成为构建
Web应用程序的非常流行的方法。我不明白,以及我希望你们评论的是,这些方法是如何构建网页应用程序的最佳方式。我来自传统的Struts / JAVA世界和传统的MVC架构。在我看来,我可能是错的,
PHP和JSF似乎将更多的业务和数据层代码拉到视图层。我不知道这是多么好的事。使用传统方法并将代码保留在视图之外会不会更好?如何维护代码?它将分散在网页源代码(PHP页面等)中......耦合似乎非常高,并且对于重新发布而言不是一件好事。
PHP, and to a lesser degree JSF has become very popular ways to build
web applications. What I don''t understand, and what I would like you
all to comment on, is how these methods are the best way to build web
applications. I come from the traditional Struts/JAVA world and the
traditional MVC archetecture. It seems to me, and I could be wrong,
that PHP and JSF seem to be pulling more business and data layer code
up to the View Layer. I don''t see how this is a good thing. Wouldn''t
it be better to use the traditional method and keep the code out of
the view? How does one maintain the code? It will be scattered across
web source code (PHP pages, etc.)... The coupling would seem to be
really high and that can''t be a good thing for reusue..



PHP非常适合简单的东西,但是如果你想写一个毛茸茸的,复杂的
web应用程序,我会选择RubyOnRails或Seaside。 />
请参阅 http:/ /www.vanderburg.org/Blog/2003/...ges/wrong_turn


neodem写道:
似乎我,我可能是错的,PHP和JSF似乎将更多的业务和数据层代码提升到View Layer。我不知道这是多么好的事。


这在某种程度上是正确的。在网络开发中,很多东西都不能自然地分成几层。例如,页面导航会影响商业逻辑和演示。根据传统和结构,PHP

确实引导人们拥有扩展的表示层。我认为这只是反映了网络开发的现实:演示

非常重要,比传统应用程序更重要。如果你的b
网站很难或难以浏览,访问者会去其他地方。

使用传统的
方法并不是更好视图中的代码?如何维护代码?它将分散在Web源代码(PHP页面等)中......耦合似乎非常高,并且对于重用而言不是一件好事。
It seems to me, and I could be wrong, that PHP and JSF seem to
be pulling more business and data layer code up to the View Layer. I don''t
see how this is a good thing.
That''s true to some extent. In web development many things don''t settle
naturally into separate layers. Page navigation, for example, impacts
both business logic and presentation. By tradition and structure, PHP
does steer people towards having an expanded presentation layer. I
think this just reflects the reality of web development: Presentation
is very important, more so than in traditional applications. If your
web site is ugly or hard to navigate, visitors will go elsewhere.
Wouldn''t it be better to use the traditional
method and keep the code out of the view? How does one maintain the code? It
will be scattered across web source code (PHP pages, etc.)... The coupling
would seem to be really high and that can''t be a good thing for reusue..




如果你重新考虑HTML页面是什么,那么在HTML中嵌入代码实际上很有意义。将其视为指示浏览器执行某些操作的命令列表,而不是静态文档。当你在
中插入一段PHP代码时,你只需用一种不同的语言编写代码。执行地点可能不同,但

的目的是相同的:在

页面的特定区域显示某些内容。通过这种方式,代码嵌入是一种在一个位置整合代码与

相关的视觉冲击的方法。



Embedding code in HTML actually makes a lot of sense if you rethink
what an HTML page is. Instead of a static document, think of it as a
list of commands directing the browser to do certain things. When you
insert a block of PHP of code in its midst, you''re just coding in a
different language. The place of execution might be different, but the
purpose is the same: to display something at the particular area of the
page. Viewed this way, code embedding is a way to consolidate code with
related visual impacts at one location.


neodem写道:
neodem wrote:

PHP,在较小程度上,JSF已经成为构建Web应用程序的非常流行的方式。我不明白,以及我希望大家发表评论的是这些方法是如何构建Web应用程序的最佳方式。


没有构建Web应用程序的最佳方式这样的东西。

相反,你必须想到最合适的东西。鉴于

应用程序的复杂程度,对操作系统和数据库后端的偏好,开发时间和成本考虑因素,

,也许是基础产品的可用性(即第三方

产品,可以快速扩展到所需的功能

规格)。

我来自传统的Struts / JAVA世界和传统的MVC架构。在我看来,我可能是错的,PHP和JSF似乎正在将更多的业务和数据层代码提升到视图层。我不知道这是多么好的事。


非常简单。从头开始开发速度更快。而且,不是每个人都认为OOP是个好主意。一旦你意识到你不需要被OOP束缚,并且可以随时回到好的旧程序

编程,坚持任何面向对象的

架构变得没有实际意义。

使用传统方法并将
代码保留在视图之外不是更好吗?如何维护代码?


您假设需要维护代码,这并非总是如此。例如,考虑快速原型制作;你想快速建立原型,完全了解(1)无法保证

应用程序将通过原型进化,以及(2)如果

应用程序实际上已经过去了原型,没有

保证生产版本将以相同的原因写成原型是。在这种情况下,框架的使用将仅仅增加原型制作的成本...

有人能让我知道我错在哪里吗?

PHP, and to a lesser degree JSF has become very popular ways
to build web applications. What I don''t understand, and what I
would like you all to comment on, is how these methods are the
best way to build web applications.
There is no such thing as "the best way to build Web applications".
Rather, you must think of the "most appropriate" way, given the
applicaiton''s level of complexity, preferences regarding the operating
system and database back-end, development time and cost considerations,
and, perhaps, availability of a foundation product (i.e., a third-party
product that can be quickly extended to required functional
specifications).
I come from the traditional Struts/JAVA world and the traditional
MVC archetecture. It seems to me, and I could be wrong, that
PHP and JSF seem to be pulling more business and data layer
code up to the View Layer. I don''t see how this is a good thing.
Very simple. It''s faster to develop from scratch. Also, not everyone
is convinced that OOP is such a good idea. Once you realize that you
need not be shackled by OOP and can go back to good old procedural
programming any time you want, adherence to any object-oriented
architecture becomes a moot point.
Wouldn''t it be better to use the traditional method and keep the
code out of the view? How does one maintain the code?
You are assuming that code needs to be maintained, which is not always
the case. Think of rapid prototyping, for example; you want to build
the prototype quickly, knowing full well that (1) there is no guarantee
that the application will evolve past the prototype, and (2) if the
application does in fact evolve past the prototype, there is no
guarantee that the production version will be written in the same
language the prototype was. In this case, the use of a framework will
only add to the cost of prototyping...
Can someone give me an idea of where I am wrong?




有两个方面:(1)OOP不是用PHP编程的唯一方法,而且(2)

不是每个应用程序都是为了维持。


干杯,

NC



On two counts: (1) OOP is not the only way to program in PHP, and (2)
not every application is meant to be maintained.

Cheers,
NC


这篇关于PHP是创建Web应用程序的最佳方式吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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