I recently ran across this pattern(?) in our code and wondering how it is useful, if at all. We have a Spring app and a Flex front-end using BlazeDS. It was decided that we use interfaces on our DTOs, like so:
Java
public interface ISomeDTO {
Integer setId();
void getId(Integer i);
}
public class SomeDTO implements ISomeDTO
{
..
}
Actionscript
public interface ISomeDTO {
var id:Integer;
}
public class SomeDTO implements ISomeDTO
{
..
}
What does an interface on a DTO gain you? These are lightweight objects with absolutely zero logic. DTOs make sense, interfaces make sense, but not together.