On Dec 12, 4:17 am, David King <[EMAIL PROTECTED]> wrote:
> > I really like erlyweb.  Once of the problems I'm having with it is
> > that some of the idioms required to do common things in the view
> > require a bit more erlang knowledge than I would like and it would
> > be good if this could be abstracted for the common cases to allow
> > designers without erlang knowledge to still maintain the templates.
>
> Then people that don't want to learn Erlang will have to learn your
> FOREACH construct. Then someone will come along asking for an easier
> way to do your FOREACH construct, and so on.

I don't agree that a suggestion for a simpler idiom should be
immediately ruled out on the basis that people will want increasingly
simpler versions.  The FOREACH is just an example to illustrate the
idea.  I'm simply advocating a way to define inline chunks of HTML in
cases where you don't need a component because the output is not
generic enough to be reused.  I think this is pretty common and it
would be nice if there was a macro for it.  I'm not a designer - but I
work with designers who don't have a functional programming mindset
but they can instantly relate to foreach / if style constructs and
they prefer inline definitions for non-reusable output.

> IMHO, I'm afraid you'll just have to learn the idioms. Your best bet
> is to not do this in the view at all. In fact, I don't recommend
> passing artist objects into the views at all, only the viewable text
> itself.
>
> Erlyweb has a good component system. I recommend learning it, and
> using it instead of trying to do much in the view. Yes, this means
> learning some Erlang.
>....

Thanks.  That is a nice example.  I need to study it some more.  I
fundamentally agree that the view should be as simple as possible with
little or no inline erlang code.  I'm just saying it would be nice if
your example could have the compnents inlined in some way, I'm not
saying FOREACH is the right way to do it, I'm just thinking out loud
mostly.  Your example is really elegant I'd just rather than the
controller didn't have to know that "song" and "album" components
exist in the view.

Thanks

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"erlyweb" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at 
http://groups.google.com/group/erlyweb?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to