• Post Reply Bookmark Topic Watch Topic
  • New Topic

properties usage in ejb,not others

 
ajay verma
Ranch Hand
Posts: 37
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
why we use the properties (legacy class),not other legacy classes in ejb?
kindly post the the suitable answer!
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35709
408
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Ajay,
Do you mean the Properties object that loads a property file? While this class has been around a while, it is hardly an outdated class.
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Properties can indeed be regarded as a legacy class as it is a subclass of Hashtable, which has largely been replaced by HashMap.

But Properties lives on in EJB servers. Why? I suspect it is because there is a lot of legacy code. Bear in mind that some of these servers were first released up to 10 years ago, and there may well be legacy code which is still used to read configuration data in Properties.
 
Jeanne Boyarsky
author & internet detective
Marshal
Posts: 35709
408
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Right. But what is the "non-legacy" alternative to the Properties object?
 
Roger Chung-Wee
Ranch Hand
Posts: 1683
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Since Java 1.4, java.util.prefs.Preferences is available. Preferences seems to provide the functionality of Properties and a lot more as well. Warning: the API documentation is not the easiest to understand.

Another alternative is to use XML. Some years ago, in migrating from WebLogic Server 5.1, I remember that we had to convert the weblogic.properties files to the config.xml configuration files.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!