Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Which one best replaces HashMap

 
Arjun Karthick
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,
I was using HashMap to store the configuration details as name/value pair.This causes lot of objects to be created at runtime as there are lot of name/value pair under different section in the configuration in which each section requires a new hashmap.

Is there any alternative way to store the name/value pair of configuration in a more efficient manner.How good does properties file suit this requirement.
Please suggest me in this.
Regards,
Arjun.
 
Chandra Bhatt
Ranch Hand
Posts: 1710
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Arjun,

Are you talking about Properties class of "java.uti.Properties"?
Give little more detail what configuration you put in the HashMap and find Properties a suitable sunbstitute of HashMap.



Thanks and Regards,
cmbhatt
 
Arjun Karthick
Ranch Hand
Posts: 77
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
yes i mean java.util.properties.
My HashMap will look like this


Does this can be handled using properties file?

thanks,
Arjun.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic