Announcement Announcement Module
Collapse
No announcement yet.
Support for new Vector type? Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • Support for new Vector type?

    Hello Christophe,

    I haven't had time to test it yet, but I;m pretty sure it won't work, so therefore my question:
    Will there be support for the new Vector type in Spring AS?
    I can imagine something like this:

    <property name="myProp">
    <vector type="IMyInterface">
    <value type="ref">MyIinstance</value>
    </vector>
    </property>

    As Flex 4 is right around the corner I guess demand for this will be high in a very short time, what do you think?

    thanks a lot in advance, I love Spring AS and am glad to see it taking on momentum!

    Roland

  • #2
    hmm, might be problems

    Hm, you might run into some problems with this Vector type though.
    I've been fooling around with trying to instantiate one dynamically, but the compiler keeps on kicking me in the teeth.

    Apparently this is not legal:

    new Vector.<cls>();

    where cls is a variable of type Class. I guess it's impossible to instantiate a Vector dynamically because the compiler needs to now the type at compile-time.

    So much for generics in actionscript I guess. I hope I'm wrong on this one, otherwise it'll throw quite the spanner in the works...

    any thoughts anyone?

    cheers,

    Roland

    P.S. Then again, I'm working with the beta version of the flex 4 compiler, it just might work by the time its finished...
    Last edited by 666shooter; Dec 19th, 2008, 07:09 AM. Reason: forgot something to say

    Comment


    • #3
      workaround

      there's an ugly workaround I guess. You can populate an untyped array through the Spring configuration and feed it to your object instance, in the instance you can convert the array to a vector like this:

      var v:Vector.<String> = Vector.<String>(untypedArray);

      not very elegant I guess...

      Comment


      • #4
        Hi Roland,

        thanks for looking into this. I would definitely be interested in supporting this, but as you can see it doesn't really make sense since you can't create typed vectors at runtime.

        Perhaps you should file a features request in the Adobe Jira. If you do so, post the link so we can all vote.

        regards,
        Christophe

        Comment


        • #5
          Hey Christophe,

          I'd already asked the question over here:

          Adobe Help

          But it seems they're not very responsive on that site, so I'll file a JIRA bug and post the link here as you suggested.

          -Roland
          Last edited by 666shooter; Dec 28th, 2008, 01:27 PM. Reason: typo...

          Comment


          • #6
            feature request added

            I've decided to add it as a feature request, I wasn't sure if I should classify this as a bug. Its more of a limitation of the compiler I guess.

            But I filed it over here, so if as many people would like to vote for it, please do:

            http://bugs.adobe.com/jira/browse/FP-1282

            I hope I phrased the request correctly, if anybody has a better way of putting it to words, please help me out here

            cheers,

            Roland
            Last edited by 666shooter; Jan 7th, 2009, 02:40 AM. Reason: Bug was moved from flex compiler to flash player, so URL was updated

            Comment

            Working...
            X