Did you get solution to this problem?

On Tuesday, July 31, 2012 3:20:21 AM UTC-4, rkulisas wrote:

> Hi, 
>
> I have 4 interfaces:
>
> public interface Ainterface{
>    getName()/setName();
>    getShape()/setShape();
> ....
> }
>
> public interface Binterface extends Ainterface{
>    getWidth()/setWidth();
>    getHeight()/setHeight();
> ...
> }
> public interface Cinterface extends Ainterface{ 
>    getRadius()/setRadius();
> ... 
> }
> public interface Dinterface {
>    Ainterface getA();
>    void setA(Ainterface a);
> ...
> }
>
> I have included all interfaces in my AutoBeanFactory.
>
> Question: when I decode/encode Dinterface, how do I know if Ainterface is 
> extended by Binterface or Cinterface? How does AutoBean support 
> polymorphism? 
>
> To make it easier, I can add a variable (for ex, shape) in Ainterface to 
> indicate which Binterface or Cinterface I have and then cast Ainterface to 
> Binterface/Cinterface. However, I run into ClassCastException. Should I 
> have separate interfaces; one that consists Binterface and one consists 
> Cinterface? Is there other solution to this problem? 
>
> Thank you,
>

-- 
You received this message because you are subscribed to the Google Groups 
"Google Web Toolkit" group.
To view this discussion on the web visit 
https://groups.google.com/d/msg/google-web-toolkit/-/8WhkOs0iwTAJ.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/google-web-toolkit?hl=en.

Reply via email to