[Catalyst] Componentised actions.

Thomas Wittek mail at gedankenkonstrukt.de
Fri Mar 30 12:59:07 GMT 2007


Oleg Pronin schrieb:
> This might be useful for including completed components (with logic,
> view and model inside) in any website place.
> For example you can create url-action which edits some objects and
> include it in many templates. This is not like
> ordinary template toolkit's include - this component can show itself,
> modify data, receive request params etc, like
> any web page.

Interestingly this is very much, what I'm doing in my Konstrukt
Framework[1][2] (which of course is not even near as powerful as
Catalyst): Each component will be inserted as a tag in a webpage. You
can put multiple components into one page as well as combine (nest)
them, if possible.

A I started to develop this framework some years ago, I thought this
concept is a good idea, and in some cases it's really nice: For example
you can put the "hit statistics" component into the master template and
_every_ web page now runs that component and fills the statistics. Each
component completely handles its logic, model and view. It's a bit like
a widget, that you can put inside your page.

Now the disadvantages of my framework:
- No "REST" by default. You cannot call a component by URL. This is what
I'm missing most. The components have to be integrated in a web page, to
which the URL points to.
- Views/controllers get mixed up a bit: The client requests a page. This
page contains markup that determines the general layout (view) and the
components (kind of controller), which in turn return the output (view)
for themselves.

So I'm able to compose components easily, but only at the cost of a less
clear separation of views and controllers. This design flaw might cause
problems in bigger projects.

Unfortunately I've not yet come up with an idea to combine the
advantages of a clear separation between views and controllers with a
_simple_ approach to compose several components and use them like
widgets inside your page. Although the suggestion of Nilson Santos F.
Jr., who also replied to your mail, seems to come close to that.

[1] http://search.cpan.org/~twittek/Konstrukt-0.5-beta7/
[2]
http://search.cpan.org/~twittek/Konstrukt-0.5-beta7/lib/Konstrukt/Doc.pod
-- 
Thomas Wittek
http://gedankenkonstrukt.de/
Jabber: streawkceur at jabber.i-pobox.net



More information about the Catalyst mailing list