Thursday, September 24, 2009, 9:27:35 AM, Attila Szegedi wrote:
> On 2009.09.23., at 19:16, Daniel Dekany wrote:
>
>> Wednesday, September 23, 2009, 9:54:16 AM, Attila Szegedi wrote:
>>
>>> On 2009.09.23., at 9:51, Daniel Dekany wrote:
>>>
>>>> Anyway, I still didn't get something here... Why do something
>>>> implement TemplateSequenceModel if it doesn't support get(int)? What
>>>> do I miss?
>>>
>>> Nothing. It doesn't really makes sense. We should really have a
>>> separate ListModel and CollectionModel in f.ext.beans.
>>
>> That's too late now, I think... /-:
>
> Why? I don't think that changing BeansWrapper so that it wraps Lists
> in a new "ListModel extends CollectionModel implements
> TemplateSequenceModel" and all other Collections in a "CollectionModel
> extends StringModel implements TemplateCollectionModel" would cause
> any BWC problems. And it fixes the bug.
OK, I didn't dig into this, so maybe now it doesn't apply, but you
fiddle with public API there, which is seldom *strictly* BC. Only if
CollectionModel had no public constructor... but it has, so what if
someone has extended CollectionModel model? Maybe that's practically
impossible, in which case go ahead.
(BTW, I usually try to final everything that I didn't explicitly
designed to be extended, or prevent it to be extended with the
constructors. (Not that Java's Hello-World-optimized visibility rules
don't make this hard... but at least now they try to fix this with
superpackages.) I know it's a really annoying style for many, and they
will say, "Why the **** don't you just make it public and document
that there are no backward-compatibility there? ARGH!". But then, why
do they want that, if not for doing exactly that they aren't supposed
to do? So it's like "Why the **** don't you just let us risk shooting
ourselves on foot, if we chose to?" Well... I don't know... maybe I
think I'm your father. ;) Seriously, part of the goodness of your sw
is if how much people like it (after all, you write it to serve human
beings), but then, there is the danger of a kind of prostitution,
where you give up what you believe/know is right for popularity. Here,
if many want to extend a class, then maybe you will hear about it, and
you can add a correct extension mechanism (a config. option or like),
and that's more convenient and safer for the users than "hack" your
classes...)
>> I thought maybe emulating the
>> get(int) could help, but then you had to keep the iterator alive, so
>> you can fetch all indexed items from the same iterator... doesn't
>> sound good.
>
> No, that doesn't.
>
>>
>> Anyway, I go ahead and fix this ?seq_contains thing. And maybe some
>> other similar builtins (seq_index_of, etc.) has the same problem.
>>
>>> Attila.
>>
>> --
>> Best regards,
>> Daniel Dekany
--
Best regards,
Daniel Dekany
------------------------------------------------------------------------------
Come build with us! The BlackBerry® Developer Conference in SF, CA
is the only developer event you need to attend this year. Jumpstart your
developing skills, take BlackBerry mobile applications to market and stay
ahead of the curve. Join us from November 9-12, 2009. Register now!
http://p.sf.net/sfu/devconf_______________________________________________
FreeMarker-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/freemarker-devel