Wednesday, August 26, 2009

Information rendering: from sensors' readings to composable information units

Code on svn repository is at a very interesting point: I need now to define how to render a DTO java object (the paylod in jmx notifications received by virtualized sensors), into a knowledge domain, how to render them into a composable information unit, removing its original nature of jmx:

package it.free.i.virtual.machine.hal.devicealias.echo;

import it.free.i.virtual.machine.hal.devicealias.command.DeviceAliasPortCommand;
import it.free.i.virtual.machine.hal.devicealias.laboratory.positioningsystem.physics.CenterOfMassPosition;
import it.free.i.virtual.machine.hal.devicealias.laboratory.positioningsystem.physics.LinearVelocity;

/**
* Positioning data DTO impl
* @author stefano
*/
public class PositionEchoImpl extends EchoImpl implements PositionEcho {

private CenterOfMassPosition centerOfMassPosition = null;
private LinearVelocity linearVelocity = null;
private DeviceAliasPortCommand deviceAliasPortCommand = null;

public PositionEchoImpl(){
super();
}

/**
* @return the centerOfMassPosition
*/
public CenterOfMassPosition getCenterOfMassPosition() {
return centerOfMassPosition;
}

/**
* @param centerOfMassPosition the centerOfMassPosition to set
*/
public void setCenterOfMassPosition(CenterOfMassPosition centerOfMassPosition) {
this.centerOfMassPosition = centerOfMassPosition;
}

/**
* @return the linearVelocity
*/
public LinearVelocity getLinearVelocity() {
return linearVelocity;
}

/**
* @param linearVelocity the linearVelocity to set
*/
public void setLinearVelocity(LinearVelocity linearVelocity) {
this.linearVelocity = linearVelocity;
}

/**
* Set the command that caused this response to be generated
* @param deviceAliasPortCommand is the source do read command
*/
public void setInitiaLDeviceAliasPortCommand(DeviceAliasPortCommand deviceAliasPortCommand) {
this.deviceAliasPortCommand = deviceAliasPortCommand;
}

/**
* Get the command that caused this response to be generated
* @return source command that caused the do read operation
*/
public DeviceAliasPortCommand getInitiaLDeviceAliasPortCommand() {
return this.deviceAliasPortCommand;
}


}
In other words: I have some setters and getters and values associated. I think that the name of the method could generally become the name of a property, whose value is obtained invoking that method. Doesn't matter the semantic of the name of the property, they just have not to collide each other or overlap (this approach satisfy this need and make it simple to see original data). Can be that every composable information unit is a bunch of key-value pairs, where the keys are the methods' names and values associated are the values obtained invoking the "keys" ? Of course a dto can have nested objects to render in a flattened representation (no nested objects please), so every dto must provide its rendered version because of the paradigm interface defining what a payload for jmx notifications is.

No comments: