Wednesday, May 15, 2013

Re: [android-developers] Custom Base Adapter.

Piren wrote:
Are you sure we're talking about Android here? What's wrong with Vector? ArrayList is good for most occasions but Vector has its merits...  you got it wrong

Of course. 'Vector' carries cruft that isn't part of the Collections framework, and 99% of the time you don't 
want its naive synchronization.
 
regarding the SimpleAdapter anyhow (they use any implementation of List, which Vector is.. they dont need ArrayList... the description saying it needs an ArrayList is a mistake).

I go by the documentation. So sue me. Anyway, you don't refute my point, which is that there is nothing
in the docs to indicate you might want to use crappy ol' 'Vector'.
 
 Vector isn't really dead...It can make things simple if you want to deal with concurrency easily.

Not true. It can give the *illusion* of simplicity without solving your real concurrency problems.

For better control, don't use 'Vector', use 'Collections.synchronizedList()' or one of the 'java.util.concurrent' 
or related types.
 
Stack is also a subclass of it, so those should count as well :)

Right. Don't use 'Stack' either.
 
Also, how is Hashtable obsolete for android development? you got any better alternative for its purposes?  I think you're thinking of the C# classes which are rather obsolete replaced by Dictionary and List... but unless he's a Mono developer, he's using Java :)

WTF? Why are you ranting about Mono? That's damn random of you.

'java.util.HashMap' has been the preferred alternative since 1998. When did you start to learn Java?

Lew wrote:
bob wrote:
It sounds like he may want to call Collections.sort() on the backing collection.  Probably a Vector.


Why do you say "probably" a 'Vector'? The standard Android classes that use a collection include 
that uses 'ArrayList', not 'Vector'. I was not able in a brief search to find anything in the Android docs 
that would lead a person to use 'Vector'.

It is striking to me how much pernicious life the 'Vector' class has even fifteen years after it was declared obsolete.

Ditto 'Hashtable' but somewhat less so.

-- 
Lew
 

--
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
---
You received this message because you are subscribed to the Google Groups "Android Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to android-developers+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

0 Comments:

Post a Comment

Subscribe to Post Comments [Atom]

<< Home


Real Estate