[API] Code snippet I .- fast property retrieval (not unit aware)

Hi,

Here a start a series of code snippets trying to center the discussion
on the DDRPropertyValue object and its methods. The most simple property
retrieval is the so-called fast food version. Here is an example

DDRPropertyValue value = ddr.getPropertyValue("resolution_width",key);
System.out.println("Retrieved value:" + value.getValue());

So here comes the first question:

Now the DDRPropertyValue has a getValue method that returns an Object.
Do we want it to be as generic as an object or do we want specific
methods such as 

getBoolean()
getInteger()
getDouble()
getString()

??? 

Also from my example it seems to be good (at least in Java) to have an
implemented toString() method at the level of DDRPropertyValue that will
return the property value as an String, simplifying even more the task
for the developer, that will print the value with
System.out.println(value) where value is a DDRPropertyValue object. That
toString() method will actually call the getString() method.

Best Regards

----
José Manuel Cantera Fonseca
Telefónica I+D

Received on Monday, 19 November 2007 23:12:57 UTC