You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@velocity.apache.org by Marc Logemann <de...@logemann.info> on 2002/07/19 12:14:52 UTC

wow or normal?!

Hi,

i am quite astonished that velocity is able to determine
the Type of a collection at runtime. When doing #foreach
on a collection type, i dont need to cast anything and can
just start of by doing $collection.specificTypeAttribute.

Can somebody explain me whats going on inside velocity? This
really surprised me and i must say: well done.

Thx for infos
---
greetings from
Marc Logemann
Homebase @ www.logemann.info


--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>


Re: wow or normal?!

Posted by "Geir Magnusson Jr." <ge...@adeptra.com>.
On 7/19/02 6:14 AM, "Marc Logemann" <de...@logemann.info> wrote:

> Hi,
> 
> i am quite astonished that velocity is able to determine
> the Type of a collection at runtime. When doing #foreach
> on a collection type, i dont need to cast anything and can
> just start of by doing $collection.specificTypeAttribute.
> 
> Can somebody explain me whats going on inside velocity? This
> really surprised me and i must say: well done.
> 

Normal!

Take a look at the code - basically, it just looks to see what the 2nd arg
to #foreach() is (Collection, [], iterator, enumerator) and just deals with
it accordingly.

This allows you to keep the implementation of your data model free from how
the designer uses it (for most cases...)

-- 
Geir Magnusson Jr. 
Research & Development, Adeptra Inc.
geirm@adeptra.com
+1-203-247-1713



--
To unsubscribe, e-mail:   <ma...@jakarta.apache.org>
For additional commands, e-mail: <ma...@jakarta.apache.org>