Results 1 to 5 of 5

Thread: Roadmap for generics support?

Hybrid View

  1. #1
    Join Date
    Apr 2005
    Posts
    6

    Default Roadmap for generics support?

    Hi everyone,

    Is there any official roadmap for tiger generics support?

    If still more than a week away... , any comments on what would be the
    preferred way of implementing in Spring framework?

    Regards,
    Alwyn

  2. #2
    Join Date
    Nov 2004
    Location
    Hilversum - The Netherlands
    Posts
    1,054

    Default

    Spring 1.2RC1 has java 5.0 support, but my guess is that it will take some time to generify Spring because so many developers are using it, and not everyone is allowed to use java 5.0 (there are enough developers forced to use 1.3!)

  3. #3
    Join Date
    Aug 2004
    Location
    Linz, Austria
    Posts
    391

    Default

    Well, nothing stops you from using generics in your own components, of course. Spring can nicely populate bean properties of generic collection type, for example.

    I guess the main question is: When will Spring [i]itself[/] be using generics, in in its own API? This is certainly not gonna happen in Spring 1.x, where JDK 1.3 compatibility is an important goal - while leveraging JDK 1.4 and 1.5 features when available, of course.

    We will have to maintain Spring 1.x for quite a further while: JDK 1.3 will certainly be around till 2006, and JDK 1.4 probably till 2009. To keep maintenance overhead low, we will try to provide as much optional JDK 1.5 value as possible in Spring 1.x.

    So eventually, expect Spring 2.0 to build on JDK 1.5, fully leveraging generics :-) However, Spring 2.0 is not even on the horizon yet. I would roughly estimate Spring 2.0 RC1 to be released in mid 2006 - once J2SE 5.0 and also J2EE 5.0 dominate the mainstream.

    Juergen

  4. #4
    Join Date
    Apr 2005
    Posts
    6

    Default

    No I was referring to the injection of lists.

    I found my problem. I'm migrating an existing framework, created new interfaces to test with, BUT my classes with which I tested still implemented the old interfaces. Quite a personal disappointment.

  5. #5
    Join Date
    Mar 2005
    Location
    Madrid, Spain
    Posts
    71

    Default I think it is possible

    I am using generics for defining the beans, let's say you have the following generic interface:

    interface Entity<E, PK implements Serializable> {
    List getAll()
    E getById(Pk id);
    void delete (E register);
    void deleteById(Pk key);
    }

    let's say you offer a particular implementation, for example for Hibernate

    class HibernateEntity<E, PK implements Serializable> implements Entity<E,PK>
    extends HibernateSupport
    {
    ...
    }

    Now on your code you can declare the dao field like this

    class Manager {
    Entity<Customer, String> customerDao;

    and on the application file, you can define the bean like this:

    <bean name ="customerDao" class ="HibernateEntity"/>

    This works for shure, because I have tested it

    Spring will interpret properly that the bean customerDao will be created using the class HibernateEntity for classes Customer and String. This work find thanks to the desing using interfaces like Entity.

    It is a good a simple solution for the typical Entity classses that you are going to make the same operations: insert, delete, find, find all, etc.

    I don't know if you was asking for the same problem.

    Bye,

    David

Similar Threads

  1. Replies: 7
    Last Post: Feb 1st, 2007, 01:47 AM
  2. Announcement: Spring IDE WebFlow Support Preview Release 2
    By Christian Dupuis in forum Announcements
    Replies: 2
    Last Post: Sep 15th, 2006, 11:50 AM
  3. Replies: 2
    Last Post: Sep 7th, 2005, 07:10 AM
  4. DAO Support without EJB Support
    By aryjr in forum EJB
    Replies: 1
    Last Post: Jul 11th, 2005, 10:40 AM
  5. New Spring Support Forums are Live
    By Colin Sampaleanu in forum Announcements
    Replies: 17
    Last Post: May 22nd, 2005, 12:57 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •