Skip to main content

API: 090: Method protorype change in Frame3D#get/putProperty()

1 reply [Last post]
hideya
Offline
Joined: 2003-07-22
Points: 0

Hello again,

Another (minor) API change I'm considering to make in 0.9.0.

currently Frame3D#get/putProperty()'s prototypes are:

<br />
    public Object getProperty(String name);<br />
    public void setProperty(String name, Object value);<br />

I'd like to make them to:
<br />
    public Object getProperty(Object key);<br />
    public void setProperty(Object key, Object value);<br />

The reason is, if we use a String as a key, we need to define the namespace for the string usage carefully. If it were an object, we can use a privately created object as a key, which avoids conflict, and it makes sure that the value is private to the owner of the key object (in the String case, basically everyone can peek and modify the value).

What do you folks think about the change? It should be OK since the only user of these method is AdvancedSceneManager, and the change is backward compatible (i.e. we can still use a String object as a key if we wish). If you have any comments, please let me know by Aug. 7th (Mon).

hideya

Reply viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
hideya
Offline
Joined: 2003-07-22
Points: 0

Hi Folks,

I just made this change too.

hideya

> Hello again,
>
> Another (minor) API change I'm considering to make in
> 0.9.0.
>
> currently Frame3D#get/putProperty()'s prototypes
> are:
> [code]
> public Object getProperty(String name);
> public void setProperty(String name, Object value);
> [/code]
> I'd like to make them to:
> [code]
> public Object getProperty(Object key);
> public void setProperty(Object key, Object value);
> [/code]
> The reason is, if we use a String as a key, we need
> to define the namespace for the string usage
> carefully. If it were an object, we can use a
> privately created object as a key, which avoids
> conflict, and it makes sure that the value is private
> to the owner of the key object (in the String case,
> basically everyone can peek and modify the value).
>
> What do you folks think about the change? It should
> be OK since the only user of these method is
> AdvancedSceneManager, and the change is backward
> compatible (i.e. we can still use a String object as
> a key if we wish). If you have any comments, please
> let me know by Aug. 7th (Mon).
>
> hideya