cocoon-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Berin Loritsch <blorit...@apache.org>
Subject Re: AW: [C2] Redirects
Date Wed, 11 Jul 2001 13:10:05 GMT
Ulrich Mayring wrote:
> 
> Marcus Crafter wrote:
> >
> [...]
> 
> Ok, thanks a lot for your info. I now understand it is possible, but
> extremely complicated and verbose to do redirects in Cocoon2 :-)

Oh, you aren't being fair.  Just because it is too easy to do in
scripting frameworks, doesn't mean we should allow the same abuse
of redirects in Cocoon.  You just have to think harder.

> >         I've found that over time, my sitemap testing has moved from focusing
> >         on technical nitty gritty to focusing on concepts. Its a subtle
> >         difference, but it makes conditional checking for your examples below
> >         a little easier.
> 
> I'm all for thinking in concepts, but here comes my old gripe again: the
> Sitemap is a proprietary format, I don't want to put concepts into
> proprietary structures. Concepts are things that need to be communicated
> to other departments, to other companies, to end users - you want a
> generic XML structure for that, not a Cocoon-specific thing.

Regarding logic in the sitemap, I whole-heartedly agree.  Business logic
does not belong in the sitemap.  Period.  If you do that, your business
logic is at the mercy of the sitemap administrator.

Regarding the proprietary format: there was no standard for this type of
thing.  If you show us a standard on URI space management that keeps the
filesystem and the URI space orthagonal, we will definitely look at integrating
it.  Unfortunately, this is something that is up to whatever framework
you use.

Also regarding the proprietary format:  Cocoon can be used accross many
servlet engines.  This reduces the risk of using Cocoon.  If you decide
to switch frameworks, well you have the overhead of removing one
infrastructure and implementing a new one.  I don't care how "standard"
something is--there is always some point of a little rework that needs
to be done.

> >         Now, be aware there is a trade off here, sending a redirect from
> >         within an action will mean you'll have control flow code outside of
> >         the sitemap.
> 
> IMHO control flow does not belong in the Sitemap at all, because it is a
> proprietary structure. It's ok to use proprietary structures as
> implementations of generic interfaces - but it's not good to tie
> developers to a specific, proprietary implementation of a generic
> concept.

I believe redirects as a result of business logic belong in Actions.  That
logic can be a result of a parameter or whatever--but I don't think the sitemap
is the place for it.  But given your previous arguments that you would argue
that Actions are also proprietary.  Try the advice I posted in another message:
create one Action that calls a session bean and redirects on a thrown exception.
That way, be passing a couple parameters, you can reuse the same Action for all
your complex business logic.

> > > Doing a 'grep -r sendRedirect * | wc -l' on the above app I get 104.
> > > Does this mean I have to write 104 actions? Or is it possible to write a
> > > generic redirect action
> >
> >         If they are all totally different sendRedirect tests, used only once
> >         in individual xsp pages, you may need to write a comprehensive set of
> >         actions. But I expect in reality it will be a lot less than 104.
> >         (without seeing your application. :-) )
> 
> Perhaps 80 or so. I think in its current state Cocoon2 ties me up too
> much, I want more freedom :-)

Does the solution I provided above work for you?  By tying your logic to session
beans, you have a portable infrastructure that minimizes dependance on some aspects
of Cocoon.
Mime
View raw message