Win a copy of Head First Android this week in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

Vector or array list

 
Ranch Hand
Posts: 594
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Vector are synchronized and array list are unsynchronized.Vector are most suitable when we handle with Multi threading.In Struts 1.2,Action are singleton ,work on multi threading.So for Struts 1.2 ,application Array list is suitable or Vector list
 
Ranch Hand
Posts: 1282
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The term Singleton is vastly overused, a few lines of code in a large program that is only used once is a candidate for just unrolling the loop and placing the code directly in the instruction stream. Doing so avoids several issuse that in compiler design may become nasty in unrecognized ways.

If your data structure is exposed to more than one thread, use synchronized data structures. To do otherwise is speculative.
 
Ranch Hand
Posts: 4864
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Normally if you have a List of something, it should be stored in the ActionForm, not the Action. ActionForm classes are not multithreaded. Furthermore, if you want to make an ArrayList Synchronized, you can with the following code:
 
Ranch Hand
Posts: 5575
Eclipse IDE Windows XP Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks Merrill
 
reply
    Bookmark Topic Watch Topic
  • New Topic