Hello,

> -----Original Message-----
> From: Andrei Ivanov [mailto:[EMAIL PROTECTED]

> I see here 
> http://java.sun.com/j2se/1.4.2/docs/api/java/util/Vector.html 
> that Vector implements the List interface, and I used Vector because it's 

that means that you can assign a Vector to a field of type List,
but not vice versa.

> in the ojb documentation: 

> "The association is implemented by the Vector attribute allArticlesInGroup

> on the ProductGroup class."

>
http://db.apache.org/ojb/tutorial3.html#Using%20a%20Single%20Proxy%20for%20a
%20Whole%20Collection

In that example, no proxies are used for that collection.
If I had written these classes, I would have used interface types
in the declarations and ArrayList for the instantiation.
There is a performance advantage of ArrayList against Vector,
because access to elements is synchronized in Vector.

To sum up: Vector is evil.

Olli

-- 
  Oliver Matz
  ppi Media GmbH
  Deliusstraße 10
  D-24114 Kiel
  phone +49 (0) 43 1-53 53-422
  fax           +49 (0) 43 1-53 53-2 22
  email mailto:[EMAIL PROTECTED]
  web   www.ppi.de

Explore your printnet!

DRUPA 2004
Düsseldorf, Germany, 6 - 19 May 2004, Booth 6E62


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to