created by a user at some time in the past and then included in the class
libraries... now, you write new code, extend existing classes, create
entirely new classes, etc... when it's compiled it all gets glommed
together. So what's the difference? The Date class is no more real or
concrete than the LoginVO class. The compiler is aware of both types, where
they come from, what they are derived from, what they extend, what they
implement, etc. No, I agree with Tobias and fall back on the lessons I
learned from Java.util.Vector... I think the reason you cast something is
when its runtime type would not be known and could be anything. With a
Vector you have to cast everything that you pull out because it could
potentially be any type of object that was put in, and Java wants to know
for sure what the type is coming out. I guess Flex is a little more
forgiving and will try and default type objects in certain situations, but
if you cast them then it knows for sure and would therefore be more
efficient(?) Unless... the object type is not hidden, which is the case
here. The compiler should know what that model is a LoginVO and it should
not need to be cast. I guess in this case it's simply an efficiency thing,
doesn't hurt to cast it, still works without casting it. Just confused me a
little to see something cast when it didn't need it.
Thanks!
Darren
>From: Suresh Akula <[EMAIL PROTECTED]>
>Reply-To: flexcoders@yahoogroups.com
>To: flexcoders@yahoogroups.com
>Subject: Re: [flexcoders] Flex 2 B 2 + Cairngorm 2 - Simple Question
>Date: Tue, 25 Apr 2006 14:04:35 -0700 (PDT)
>
>LoginVO is user defined object and where as Date is
>System defined object, no need to type the these
>objects.
>
>--Suresh
>
>
>
>--- Darren Houle <[EMAIL PROTECTED]> wrote:
>
> > But when? Why? In every case? If that was a
> > generic, universal rule and
> > you're supposed to cast everything as it's original
> > object type then a
> > little further in the line we should see:
> >
> > ' at ' + Date(model.loginDate) }" />
> >
> > I'm just curious why the LoginVO is cast here. Is
> > there some rule like "you
> > don't have to cast an object when simply accessing
> > an attribute of that
> > object, but you do have to cast an object if it
> > contains other objects with
> > an attributes you need to access." That sounds
> > kinda silly to me, that's
> > why I'm asking :-)
> >
> > Thanks!
> > Darren
> >
> >
> >
> > >From: Suresh Akula <[EMAIL PROTECTED]>
> > >Reply-To: flexcoders@yahoogroups.com
> > >To: flexcoders@yahoogroups.com
> > >Subject: Re: [flexcoders] Flex 2 B 2 + Cairngorm 2
> > - Simple Question
> > >Date: Tue, 25 Apr 2006 12:59:59 -0700 (PDT)
> > >
> > >Hello Darren,
> > >
> > > its good partice to typecast with orginal
> > object
> > >and invoke the object members.
> > >
> > >--Suresh Akula.
> > >
> > >
> > >--- Darren Houle <[EMAIL PROTECTED]> wrote:
> > >
> > > > I'm fairly new to Flex and really new to
> > Cairngorm
> > > > and am trying to break
> > > > Cg2 down and understand it (I'm not trying to
> > > > understand Cg.99 and then
> > > > learn Cg2, I'm just jumping into 2.) I have a
> > quick
> > > > question:
> > > >
> > > > In the Cg2 sample CairngormLogin.mxml theres a
> > Label
> > > > in the "loggedIn"
> > > > VBox...
> > > >
> > > > <mx:Label text="{ 'Logged in as ' + LoginVO(
> > > > model.loginVO ).username + ' at
> > > > ' + model.loginDate }" />
> > > >
> > > > This seems to still work fine when changed to...
> > > >
> > > > <mx:Label text="{ 'Logged in as ' +
> > > > model.loginVO.username + ' at ' +
> > > > model.loginDate }" />
> > > >
> > > > Is there some reason why the first form must be
> > used
> > > > over of the second
> > > > form? If I were writing this code myself from
> > > > scratch it would seem more
> > > > intuitive to bind directly to the
> > > > model.loginVO.username. Am I missing
> > > > something?
> > > >
> > > > Thanks,
> > > > Darren
> > > >
> > > >
> > > >
> > >
> > >
> > >__________________________________________________
> > >Do You Yahoo!?
> > >Tired of spam? Yahoo! Mail has the best spam
> > protection around
> > >http://mail.yahoo.com
> > >
> > >
> > >--
> > >Flexcoders Mailing List
> > >FAQ:
> >
>http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
> > >Search Archives:
> >
>http://www.mail-archive.com/flexcoders%40yahoogroups.com
> > >Yahoo! Groups Links
> > >
> > >
> > >
> > >
> > >
> > >
> >
> >
> >
>
>
>__________________________________________________
>Do You Yahoo!?
>Tired of spam? Yahoo! Mail has the best spam protection around
>http://mail.yahoo.com
>
>
>--
>Flexcoders Mailing List
>FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
>Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
>Yahoo! Groups Links
>
>
>
>
>
>
>
--
Flexcoders Mailing List
FAQ: http://groups.yahoo.com/group/flexcoders/files/flexcodersFAQ.txt
Search Archives: http://www.mail-archive.com/flexcoders%40yahoogroups.com
YAHOO! GROUPS LINKS
- Visit your group "flexcoders" on the web.
- To unsubscribe from this group, send an email to:
[EMAIL PROTECTED]
- Your use of Yahoo! Groups is subject to the Yahoo! Terms of Service.