Home Discussion Discuss: Preferences API - What do you Prefer? - Java Tutorials

  • Preference APIjiber January 11, 2012 at 10:51 AM

    Thanks for this article, nicely written and discusses a great concept. I read through the Java SDK documentation to only find that most of the get and put methods in this API are abstract. If I didn't read your article I would have assumed that someone would need to implement this class before I can go ahead and use it. So I would have to look for a provider and then use some system property to plug their implementation in JRE to be able to use it. There is no such thing, however. As you have shown that anyone can just use the API by using methods that return a Pref. Object and do operations on it. Is this normal for any API defined in the SDK - that it already comes with a default implementation regardless of the classes defined as abstract? I am having some difficulty understand this concept. If a classâ?? functions are declared abstract donâ??t you have to subclass it (usually you would use a different class name) to implement its methods and then instantiate the subclass to use the functionality. I hopefully have made my question clear. Also, how would I change the default backing store e.g. on windows: How would I choose not to use the registry keys but use SQL server for instance or much simpler, just a flat file( If I didn't want to use Properties file in latter case).

Post your Comment



Your Name (*) :
Your Email :
Subject (*):
Your Comment (*):
  Reload Image
 
 
Related Articles
Development process Questions

mail api - Development process
 

PHP Questions

How do you define a constant?
 

PHP Questions

How do you call a constructor for a parent class?
 

PHP Questions

How do you pass a variable by value?
 

Regex Questions

How do you add a numerical value to a regex
 

Programming Tutorials

Theming API
 

Submit-Tutorials

Submit Tutorials - Submitting Tutorials at RoseIndia.net
 

Struts-Tutorials

Struts API - Struts Framework API online
 

Java Beginners

Need to remove duplicated rows from excel using apache POI API
 

Hibernate Tutorial Example

Hibernate Criteria API
 

Software Development

HTML5 Tutorials
 

Java Beginners

how do you change the message box to a specific color
 

Programming Tutorials

E-mail Tutorials
 

PHP Questions

PHP Tutorials Guide with Examples
 

Hibernate Questions

Hibernate: ORDER BY using Criteria API.
 

C++

C Tutorials
 

JavaScript Questions

JavaScript google map API example.
 

SQL Tutorial

Mysql date API
 

jQuery

jQuery Tutorials, jQuery Tutorial
 

JDBC Questions

start debugging problems related to the JDBC API
 

Hibernate Questions

Retrieve data using Criteria api
 

iPhone

iPad Tutorials
 

Programming Tutorials

The Simple API for XML (SAX) APIs
 

Framework Questions

in an application one task has to done for every 15 minutes ? How con you do it?
 

Ajax Examples

You Tube
 

JavaMail Questions

get from address using javamail api?
 

General

Subversion Tutorials
 

Tutorials

iPhone SDK Tutorials and Examples
 

Struts 2 Tutorials

Struts 2.3.8 Tutorials and Examples
 

Java-Tutorials

JDBC: Batch Insert Example