guicamest/InterfaceToDTO — Issue #4: Provide an interface for the user to extend so that getEntityType has not to be included in every interface
Author: guicamest
Created: 2011-10-13 01:46:26+00:00
State: open

Suppose the user has two classes ( Circle, Square ) that implements an interface ( IDrawable ).

Circle c = new Circle();
Square s = new Square();

When a user generates DTO's using:

IDrawable drawableCircle = InterfaceDTOUtils.getFilledDto(IDrawable.class, c);
IDrawable drawableSquare = InterfaceDTOUtils.getFilledDto(IDrawable.class, s);

The developer has no way of knowing if drawableCircle is an instance of Circle or not.

In order to cover that case, a base interface will be provided:

public interface IBaseDTOInterface{

public String getEntityType();

}

That should return Circle if the entity was a circle or Square if the entity was a square