jvermillard / leshan

OMA Lightweight M2M java implementation - LWM2M
40 stars 25 forks source link

Delegate creation of relative path to TargetSpec instance #16

Closed sophokles73 closed 10 years ago

sophokles73 commented 10 years ago

I am very unsure about the formatting changes. Do we have a set of formatting rules for eclipse that I could use?

sbernard31 commented 10 years ago

Thx Kai, Maybe, we could do more in this way : an Observation could have a field resource typed ResourceSpec. What do you think ?

(You could use the "eclipse-code-style.xml" formatter configuration at the root folder of leshan)

sophokles73 commented 10 years ago

I am not sure if I understand correctly, do you mean that the Observation interface should have a method ResourceSpec getResource() instead of method String getResourceRelativePath() and that client code should then invoke String asRelativePath() on the ResourceSpec object itself? I could live with that as well, no problem. I only want to get rid of the duplicated code :-)

sbernard31 commented 10 years ago

that's what I mean :) Replace :

public interface Observation {

    Integer getObjectId();

    Integer getObjectInstanceId();

    Integer getResourceId();

    Client getResourceProvider();

    ResourceObserver getResourceObserver();

    String getResourceRelativePath();

    void cancel();
}

By

public interface Observation {
    ResourceSpec getResource()

    ResourceObserver getResourceObserver();

    void cancel();
}
sophokles73 commented 10 years ago

Ok, I will make the changes accordingly.

sbernard31 commented 10 years ago

"Observe" branch is now integrated in master. I will remove the branch before the end of the week.

sbernard31 commented 10 years ago

Thx Kai :)