db-ojb-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robert Sfeir <rob...@codepuccino.com>
Subject Re: Vector use
Date Mon, 14 Jun 2004 18:33:44 GMT
I guess what bugs me the most about Vector is that it's synchronized, 
and while I am not extremely familiar with the code, there are some 
spots which look like we don't need synchronization, and we could 
benefit from the added performance.

The other thing is that since Vector has been retrofitted to implement 
Collection, when we have a line like:

private Vector foo = new Vector();

wouldn't it be better to use something like:

private List foo = new Vector();
private Collection foo = new Vector();

(Depending on the purpose of course being listed v/s non discriminatory)

which should allow us to support people using 1.2 + in any case, then 
we can change our implementation underneath as we go forward and not 
affect the code.  We can apply changes to the impl as we properly 
determine sync need v/s none, and choose a better Collection when we 
see the need.



On Jun 14, 2004, at 2:23 PM, Antonio Gallardo wrote:

> Robert Sfeir dijo:
>> I've been wondering about the use of Vector and Hashtable in OJB.  Are
>> they there because we support older JDKs or is it because it's just
>> what was there when OJB was first developed?  Vector and Hashtables 
>> are
>> deprecated, and newer Collections are just more efficient.
>> I don't mind going through weeding them out, but if we intend to
>> support JDK 1.2 and before then there is no sense in doing that.  Is
>> there a large group of OJB users using JDK 1.2- ?
> I think today no one is using java 1.2 (correct me if I am wrong). As 
> you
> pointed before, it is because historic reasons. Perhaps we can change 
> to
> collections onces we release the 1.0.
> We can set J2SDK 1.3 as the minimum requirement for OJB 1.1 and later.
> That way we can switch to collections. Also there are a lot of 
> interesting
> classes in commons-collections and we can take advantage of them!
> BTW, I am waiting for the end of the month to receive this interesting 
> book:
> Pro Jakarta Commons by Harshad Oak, ISBN: 1590592832
> http://www.amazon.com/exec/obidos/tg/detail/-/1590592832/
> I hope this book will be very interesting one.
> Best Regards,
> Antonio Gallardo
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
> For additional commands, e-mail: ojb-dev-help@db.apache.org

To unsubscribe, e-mail: ojb-dev-unsubscribe@db.apache.org
For additional commands, e-mail: ojb-dev-help@db.apache.org

View raw message