Menu

#4 Iterators instead of Enumerators

open
nobody
None
5
2013-02-19
2001-02-24
No

I don't know if there is an official deprecation, but my understanding is that Iterators were ment to replace Enumerations in Java. If this is the case, JabberBeans should follow suit.

Discussion

  • Nobody/Anonymous

    At the same time it would be nice to have "get(int index)" and "size()" methods.

     
  • Mark Paschal

    Mark Paschal - 2001-02-24

    The Vector/Hashtable/Enumeration classes are still used for compatibility with older Java versions, so Jabberbeans can be used practically in applets. (I thought it was mentioned on jabberbeans-devel, but I can't find where.)

    My current project uses Swing, so I wouldn't mind a List/Map/Iterator version (fork?) of the affected classes.

     
  • David Waite

    David Waite - 2001-02-25

    Logged In: YES
    user_id=9752

    Unfortunately Iterators are a Java 2 feature, which would
    really break any sort of web usage badly - there are still
    platforms where Java 2 browser support isn't even available.

    My other qualm with Collections in general is that there is
    no support for Generics (or templates) in Java, meaning that
    you cannot have an explicit List of RosterItems (for
    instance). At the time I was starting JabberBeans, it looked
    like Generics would find there way in, and I knew the first
    thing to change would be the Collections API.

    In the end, a 1.1.x supporting version of JabberBeans is
    definately needed, and maintaining two separate versions
    (one with Collections, one without) will always be more
    trouble than maintaining one version.

    With all that said - I can the reasons for wanting a
    Collections-based API. If nothing else, it will be quicker
    because Vector is synchronized internally. Many of the
    classes in Jabberbeans also use Vector in leu of a
    more-appropriate data structure, just because none is
    available in 1.1 (prime example is the behavior of the
    OutputStreamHandler) .If others want to start working on a
    Java2 - only version of JabberBeans, I will definately let
    them work within the existing project - but again, Java
    1.1.x support is extremely important, and the two branches
    will need to be kept up.

     

Log in to post a comment.