Just looking for pointers on how to handle this situation:
I have a BaseComponentClass, with several subclasses.  Each of these
subclasses also has a corresponding VO.

All the subclass components use a getter/setter dataProvider property which
expects a vo which matches their corresponding type.  So, I'm thinking
logically the dataProvider property is defined in the BaseComponentClass and
overridden in each subclass.

The problem I run into is that you can't change the method signature in an
override, so i can't reset the expected parameter type in the overridden
prop:

                //  defined in BaseComponent:
public function get dataProvider ():BaseVO {
return _dataProvider;
}

public function set dataProvider (value: BaseVO):void {
_dataProvider = value;
dataProviderChanged = true;
invalidate();
}

                //can't do this in subclass:
override public function get dataProvider ():SubclassVO {
return _dataProvider;
}

override public function set dataProvider (value:SubclassVO):void {
_dataProvider = value;
dataProviderChanged = true;
invalidate();
}


The way I'm seeing it, I can either just use the BaseClassVO for the type,
or create an interface for the vo, but either way it seems like I'm going to
have to cast it every time I try and access it in the subclasses.

Any suggestions?

Reply via email to