You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@royale.apache.org by Carlos Rovira <ca...@apache.org> on 2020/08/23 07:47:03 UTC

UIBase with [DefaultProperty("beads")]

Hi,

there's some reason we don't make "beads" the default property for UIBase?
I think that will allow to be less verbose in mxml and remove many lines
for end users.

Other components like Group override in favor of "mxmlContent" or List for
"dataProvider"

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: UIBase with [DefaultProperty("beads")]

Posted by Carlos Rovira <ca...@apache.org>.
Hi Harbs,

ok, that makes sense. Really I think both ways are right, and is just a
matter of what we want to interpret at that point.

For example, data in dataProvider could be not seen really as content since
it's then transformed into content via item renderers.
text in a button could be seen as data and content at the same time... But
it's clear that behaviour is something more about extending functionality,
although in some cases they are content, (i.e: Jewel AssignTabContent bead).

For now will not add to StyledUIBase.

Thanks


El dom., 23 ago. 2020 a las 10:33, Harbs (<ha...@gmail.com>) escribió:

> Data is the content/children of a List/DataContainer. That makes sense to
> declare inline.
>
> Beads are behavior. It’s a different concept.
>
> text is the content of a button, so that makes sense as a default property
> as well.
>
> My point is that if something can be defined as content, it makes sense to
> declare the content inline. If it’s behavior, it doesn’t.
>
> The only exception I can see to that is when the strand itself is
> behavioral. Then it makes sense to have sub-behaviors as the default
> property.
>
> This is something I did with Routing. In the Router classes, the default
> property is in fact beads which can take the specific Routing types (i.e.
> RouteToComponent) RouteToComponent in turn has “routes” as its default
> property which takes an array of ComponentRoutes.
>
> This makes sense because a Router *contains routes*. With a visual
> component, it contains other visual components — not behaviors (i.e.
> layout, transforms, etc.)
>
> Am I making myself clearer?
>
> Thanks,
> Harbs
>
> > On Aug 23, 2020, at 11:13 AM, Carlos Rovira <ca...@apache.org>
> wrote:
> >
> > Hi Harbs,
> >
> > I thought it was a technical decision. As I go over components I think it
> > is a power feature for advanced users. People that master Royale can add
> a
> > j:List and use a js:ArrayList directly to define the data inline (this is
> > of course more a case for rapid prototyping of interfaces than a real use
> > case in a big app). Most people use containers to directly add childs
> > without knowing they are using "mxmlContent" really.
> >
> > In Jewel Button, we have for a long time "text" as default property, but
> > other components like TextInput. will benefit from having beads to add
> > direct optional functionality. For example, in IconButton, since is a
> > button, "text" is default, but maybe "icon" could be here the default (or
> > not). A power user will be faster coding when they know what default
> > property is the one for a particular component, and beads could be
> default
> > if we define that way at UIBase level.
> >
> > So, IMHO, I don't think we should restrict default properties to direct
> > childs, since it doesn't seem to me the real concept.
> > At least, if not something others like, maybe I can think on set that way
> > at "StyledUIBase" level for Jewel (stil to analyze a bit more).
> >
> > Thoughts?
> >
> >
> >
> >
> >
> > El dom., 23 ago. 2020 a las 9:52, Harbs (<ha...@gmail.com>)
> escribió:
> >
> >> I don’t like the idea of making beads the default property. To me the
> >> default property is used for some kind of children which changes from
> >> component to component. Beads do not fit that concept. It’ll also be
> >> confusing if some elements take beads as content and others don’t.
> >>
> >> My $0.02,
> >> Harbs
> >>
> >>> On Aug 23, 2020, at 10:47 AM, Carlos Rovira <ca...@apache.org>
> >> wrote:
> >>>
> >>> Hi,
> >>>
> >>> there's some reason we don't make "beads" the default property for
> >> UIBase?
> >>> I think that will allow to be less verbose in mxml and remove many
> lines
> >>> for end users.
> >>>
> >>> Other components like Group override in favor of "mxmlContent" or List
> >> for
> >>> "dataProvider"
> >>>
> >>> --
> >>> Carlos Rovira
> >>> http://about.me/carlosrovira
> >>
> >>
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: UIBase with [DefaultProperty("beads")]

Posted by Harbs <ha...@gmail.com>.
Data is the content/children of a List/DataContainer. That makes sense to declare inline.

Beads are behavior. It’s a different concept.

text is the content of a button, so that makes sense as a default property as well.

My point is that if something can be defined as content, it makes sense to declare the content inline. If it’s behavior, it doesn’t.

The only exception I can see to that is when the strand itself is behavioral. Then it makes sense to have sub-behaviors as the default property.

This is something I did with Routing. In the Router classes, the default property is in fact beads which can take the specific Routing types (i.e. RouteToComponent) RouteToComponent in turn has “routes” as its default property which takes an array of ComponentRoutes.

This makes sense because a Router *contains routes*. With a visual component, it contains other visual components — not behaviors (i.e. layout, transforms, etc.)

Am I making myself clearer?

Thanks,
Harbs

> On Aug 23, 2020, at 11:13 AM, Carlos Rovira <ca...@apache.org> wrote:
> 
> Hi Harbs,
> 
> I thought it was a technical decision. As I go over components I think it
> is a power feature for advanced users. People that master Royale can add a
> j:List and use a js:ArrayList directly to define the data inline (this is
> of course more a case for rapid prototyping of interfaces than a real use
> case in a big app). Most people use containers to directly add childs
> without knowing they are using "mxmlContent" really.
> 
> In Jewel Button, we have for a long time "text" as default property, but
> other components like TextInput. will benefit from having beads to add
> direct optional functionality. For example, in IconButton, since is a
> button, "text" is default, but maybe "icon" could be here the default (or
> not). A power user will be faster coding when they know what default
> property is the one for a particular component, and beads could be default
> if we define that way at UIBase level.
> 
> So, IMHO, I don't think we should restrict default properties to direct
> childs, since it doesn't seem to me the real concept.
> At least, if not something others like, maybe I can think on set that way
> at "StyledUIBase" level for Jewel (stil to analyze a bit more).
> 
> Thoughts?
> 
> 
> 
> 
> 
> El dom., 23 ago. 2020 a las 9:52, Harbs (<ha...@gmail.com>) escribió:
> 
>> I don’t like the idea of making beads the default property. To me the
>> default property is used for some kind of children which changes from
>> component to component. Beads do not fit that concept. It’ll also be
>> confusing if some elements take beads as content and others don’t.
>> 
>> My $0.02,
>> Harbs
>> 
>>> On Aug 23, 2020, at 10:47 AM, Carlos Rovira <ca...@apache.org>
>> wrote:
>>> 
>>> Hi,
>>> 
>>> there's some reason we don't make "beads" the default property for
>> UIBase?
>>> I think that will allow to be less verbose in mxml and remove many lines
>>> for end users.
>>> 
>>> Other components like Group override in favor of "mxmlContent" or List
>> for
>>> "dataProvider"
>>> 
>>> --
>>> Carlos Rovira
>>> http://about.me/carlosrovira
>> 
>> 
> 
> -- 
> Carlos Rovira
> http://about.me/carlosrovira


Re: UIBase with [DefaultProperty("beads")]

Posted by Carlos Rovira <ca...@apache.org>.
Hi Harbs,

I thought it was a technical decision. As I go over components I think it
is a power feature for advanced users. People that master Royale can add a
j:List and use a js:ArrayList directly to define the data inline (this is
of course more a case for rapid prototyping of interfaces than a real use
case in a big app). Most people use containers to directly add childs
without knowing they are using "mxmlContent" really.

In Jewel Button, we have for a long time "text" as default property, but
other components like TextInput. will benefit from having beads to add
direct optional functionality. For example, in IconButton, since is a
button, "text" is default, but maybe "icon" could be here the default (or
not). A power user will be faster coding when they know what default
property is the one for a particular component, and beads could be default
if we define that way at UIBase level.

So, IMHO, I don't think we should restrict default properties to direct
childs, since it doesn't seem to me the real concept.
At least, if not something others like, maybe I can think on set that way
at "StyledUIBase" level for Jewel (stil to analyze a bit more).

Thoughts?





El dom., 23 ago. 2020 a las 9:52, Harbs (<ha...@gmail.com>) escribió:

> I don’t like the idea of making beads the default property. To me the
> default property is used for some kind of children which changes from
> component to component. Beads do not fit that concept. It’ll also be
> confusing if some elements take beads as content and others don’t.
>
> My $0.02,
> Harbs
>
> > On Aug 23, 2020, at 10:47 AM, Carlos Rovira <ca...@apache.org>
> wrote:
> >
> > Hi,
> >
> > there's some reason we don't make "beads" the default property for
> UIBase?
> > I think that will allow to be less verbose in mxml and remove many lines
> > for end users.
> >
> > Other components like Group override in favor of "mxmlContent" or List
> for
> > "dataProvider"
> >
> > --
> > Carlos Rovira
> > http://about.me/carlosrovira
>
>

-- 
Carlos Rovira
http://about.me/carlosrovira

Re: UIBase with [DefaultProperty("beads")]

Posted by Harbs <ha...@gmail.com>.
I don’t like the idea of making beads the default property. To me the default property is used for some kind of children which changes from component to component. Beads do not fit that concept. It’ll also be confusing if some elements take beads as content and others don’t.

My $0.02,
Harbs

> On Aug 23, 2020, at 10:47 AM, Carlos Rovira <ca...@apache.org> wrote:
> 
> Hi,
> 
> there's some reason we don't make "beads" the default property for UIBase?
> I think that will allow to be less verbose in mxml and remove many lines
> for end users.
> 
> Other components like Group override in favor of "mxmlContent" or List for
> "dataProvider"
> 
> -- 
> Carlos Rovira
> http://about.me/carlosrovira