ah, i think i see what i was doing wrong...I was also storing the reference
in the BaseClass:
    protected var _dataProvider:BaseVO;

What was happening was that even though I was casting in the setter, in all
my subclass' methods that refer to the _dataProvider, I had to keep
recasting.  Seems like i need to not have that storage reference in the base
calss, and create a different one for each subclass.


On Thu, Apr 17, 2008 at 5:41 PM, gabriel montagné <
[EMAIL PROTECTED]> wrote:

>   On Thu, Apr 17, 2008 at 5:27 PM, Josh McDonald <[EMAIL 
> PROTECTED]<dznuts%40gmail.com>>
> wrote:
> >
> > What do you mean by VO?
>
> VO means ValueObject (a.k.a. DTO (Data Transfer Object)) .. It's a
> simple object, with no logic, used to carry data around in typed
> bundles. Instead of using an anonymous object like
> { username: "Castros", password :"Bar", id:666 }, you have a typed
> UserVO object for which you can expect that you'll have a username
> :String, password :String, id:uint.
>
> Rich, I think you'll probably have to cast on the setter every time
> for subclasses. Of course, internally, you'll want to have a typed
> copy of your data.
>
> override public function set dataProvider(value :BaseVO) :void {
> _myTypedData = value as SubclassVO;
> //... invalidate.. etc.
> // ....
> }
>
> I does make sense, though: outside classes that are expecting your
> particular interface don't really know that subclasses can use more
> sophisticated subclassed version of your object. You'll have to
> choose at what level of specificity you want to define your interface.
>
> If you find a cleaner solution, though, it'd be cool to know!
>
> --
> gabriel montagné láscaris comneno
> http://rojored.com
> t/506.8392.2040
>
>  
>

Reply via email to