component based php architecture

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View


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

I would like to request for some pointers to such frameworks (if exist)
that are based on PHP.


Re: component based php architecture

Quoted text here. Click to load it

I don't think it's equivalent with Smarty.

Smarty is a template engine, making a comparison with JSP more
reasonable. Meaby you want to have a look at the WACT taglibs too...

Quoted text here. Click to load it

We've hadded our discussions on frameworks and components etc... Not
going to do that again. List (and comparisons) can be found in the group

Met vriendelijke groeten,
Tim Van Wassenhove <

Re: component based php architecture


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, wrote:
Quoted text here. Click to load it

Re: component based php architecture

thanks for your reply.

as far as frameworks go, we're currently developing with struts and
have apx. 40 pages. the annoying thing is that for every new page you
have to create a set of java classes, that changes to pages tend to
break them and that there's no components to reuse layout etc.

we're looking at php exactly for the reason you've mentioned: its
simplicity and short development-deploy cycle. however, going ahead and
developing our web interface using simple php-in-html will be a
nightmare i think.

i want to be able to have presentation components that allow me to
assemble a page only on the view side, with no coding needed. i want
something that tracks changes that the user has made before submit for
me, rather than need to do it on my own. i want to be able to easily
reuse presentation items like tables (with sorting), menues etc., and
not have to write them on my own every time.

and, i want it all to be simple to understand ;-)


Re: component based php architecture wrote:

Quoted text here. Click to load it

ittay: we developed something like that for ourselves.  Because we wrote it,
we can use it like it is late-beta, but for someone else it would be more
like early alpha.  If you are intestested, drop me an email (see sig

The design assumption is that you would prefer *zero* coding if possible, so
it never makes you do anything routine, the only time you do anything is to
make an explicit exception to its normal behavior.  There is never anything
that starts off, "Now you must remember on each page to do step X...."

You use it by defining a database structure, including automation and
constraints.  It builds the database for you (PostgreSQL) and then puts a
copy of the data dictionary into the web server, where run-time PHP
libraries read the data for particular tables and serve up appropriate
pages.  There are extensive facilities for overrides and customization, but
again, our own design goals are to never actually use those, we want
everything data driven.

Kenneth Downs
Secure Data Software, Inc.

Re: component based php architecture

Quoted text here. Click to load it

Take a look at .
You can run the sample online, then download all the source code to see how
it works. This works with PHP 4 or PHP 5.

Tony Marston

Re: component based php architecture

ok, for what it's worth, i've found and

phptal is like tapestry in many aspects, wact seems to draw on a lot of
good patterns.

Site Timeline