[Seaside] click images and questionable API

Julian Fitzell julian at beta4.com
Thu Mar 20 15:08:15 CET 2003



Nevin Pratt wrote:
> Avi Bryant wrote:
>> ...may not seem much of an advantage when using literal text, but what
>> if those are variables instead?  Then your simple use of #text: becomes
>>
>> aRenderer text: '<meta name="',someName,'" content="',someContent,'">'
>>
> 
> Well,  your example has literal text, too.  What if it was using 
> variables instead?  For example, you mentioned:
> 
> aRenderer metaTags: {'Foo' -> 'Some description of Foo'. 'Bar' -> '...'}.
 >
> What if instead of the literal 'Some description of Foo', you instead 
> had a description that was built from variables?

I'd still find that cleaner with variable names than one that is 
splicing them into strings.

> In other words, your code seems to suffer from the exact same problem as 
> well.  Besides, if it was such a big win, why haven't you added 
> #metaTags: and #metaTageNamed:content: methods to the renderer already?

For the simple reason that nothing we've written has used them yet. 
We've maintained the philosophy of adding stuff to Renderer when we need 
it instead of bloating it now with code that may not work the way we 
want it later.  And when people complain that things re missing we 
pretty quickly know how they want to use it.

> I'm being the devil's advocate here, but to be honest, I can feel myself 
> being pulled your way even though I've thrown up another argument 
> questioning it.

Well that's good at least ;)

> Let's look at another one of your examples:
> 
>> imageWithSource: srcUrl link: hrefUrl
>>  self attributeAt: 'href' put: hrefUrl.
>>  self tag: 'a' do: [
>>    self attributes: {'border' -> 0. 'src' -> srcUrl}.
>>    self tag: 'img'.
>>  ]
>>
>> Then you would have
>>
>> html imageWithSource: '/images/ebay' link: 'http://www.ebay.com'.
>>
>>  
>>
> 
> I like this.  But why wasn't #imageWithSource:link: in renderer already? 
> For some naive reason, I was expecting existing API to cover this case, 
> as I thought it to be a fairly mundane, common case. 

Again, same reason: we don't do much with images and what we have done 
recently we've been playing with storing in the image.

> And even though I bring up these questions, I still rate Seaside as one 
> of the best (possibly *the* best) web development framework ever devised.

I'm certainly glad we're using it at work now. :)

Julian



More information about the Seaside mailing list