Ittay,
Php isn't Java. In the first place we tend to keep things simple.
Second, in php4, which is still the main production environment, has
been kept VERY simple: there are no real object references, no
interfaces, no event model, no exceptions, no packages, no class loader,
no component model, no comparable interface, and certainly nothing like
EJB containers/application servers. If you want these things, you have
to define them yourself, or find workarounds where it's not possible to
do so. This is especially tricky with the implicit copying php4 does,
which can be a real performance killer.
Third, your objects only live for the duration of one request. This
greatly simplifies things as there is no multi threading and lifecycle
management is no big deal (caching is, if you want persistency with
domain model navigation).
Fourth, in php4 garbage collection is limited. You should avoid making
cyclic references, also becuase == does not like them.
Fifth, there is php5, that solves the most important limitations, but at
the same time is different enough to break existing OO code you want to
port from php4 (and back, if you have an installed base on existing
customers op php4). You can write your code to be portable on top of a
small version isolation layer, but if you care about references and
copying, you do need to know what you are doing.
So personally i think this is more then enough reason to use a framework
that offers solutions for these issues. But i must admit, i did both
Smalltak and Java for several years, so i guess i am pritty biased.
Anyhow, even i do think simplicity is one of the greatest features of
php, and reason enough to ask yourself if your applications really need
all this abstraction & complexity that frameworks bring.
Greetings, have fun,
Henk Verhoeven,
www.phpPeanuts.org.
it********@gmail.com wrote:
Hi,
I'm a java developer trying to get acquainted with PHP.
In java web development, the most popular web applications framework is
Struts, which is equivalent to Smarty.
The problem with both is that they don't give you a true rich web
application support. What I'm looking for is the equivalent of JSF,
tapestry etc.: creation of application components, registering
listeners to components, lifecycle management, navigation, exception
etc.
I would like to request for some pointers to such frameworks (if exist)
that are based on PHP.
Thanx,
Ittay