is Trait a behavior?

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
6 messages Options
Reply | Threaded
Open this post in threaded view
|

is Trait a behavior?

tinchodias
Hi all

I have some methods receiving either a Class or a Trait instance as
parameter, so I usually call variables with names like
'aClassOrTrait'. Searching for a more synthetic name, I wonder if
'aBehavior' would be fine.

But IMO these examples show contradictions:

- Trait *is* a behavior:

TBehaviorCategorization users --->  an IdentitySet(Class Trait)

TPureBehavior users ---> an IdentitySet(TraitBehavior Behavior)
  (actually this makes me think 'aPureBehavior' is another alternative
for my variables)

- Trait is *not* a behavior:

TBehaviorCategorization isBehavior ---> false

TClassAndTraitDescription users ---> an IdentitySet(ClassDescription
TraitDescription)
  (I both are behaviors, why not call it TBehaviorDescription?)


Thanks in advance for your help.
Martín

Reply | Threaded
Open this post in threaded view
|

Re: is Trait a behavior?

Mariano Martinez Peck


On Mon, May 14, 2012 at 10:19 PM, Martin Dias <[hidden email]> wrote:
Hi all

I have some methods receiving either a Class or a Trait instance as
parameter, so I usually call variables with names like
'aClassOrTrait'. Searching for a more synthetic name, I wonder if
'aBehavior' would be fine.

+1. For all my code that can handle both, traits and classes, I ALWAYS use the word Behavior rather than class.

Problem is that aTrait isBehavior -> false. But I think it is an implementative details and I don't like it. As you say, a trait for me is a behevior and therefore I use that word.

 

But IMO these examples show contradictions:

- Trait *is* a behavior:

TBehaviorCategorization users --->  an IdentitySet(Class Trait)

TPureBehavior users ---> an IdentitySet(TraitBehavior Behavior)
 (actually this makes me think 'aPureBehavior' is another alternative
for my variables)

- Trait is *not* a behavior:

TBehaviorCategorization isBehavior ---> false

TClassAndTraitDescription users ---> an IdentitySet(ClassDescription
TraitDescription)
 (I both are behaviors, why not call it TBehaviorDescription?)


Thanks in advance for your help.
Martín




--
Mariano
http://marianopeck.wordpress.com

Reply | Threaded
Open this post in threaded view
|

Re: is Trait a behavior?

Carla F. Griggio
+1
I also want to distinct behavior objects from others and I need to include Traits in that criteria.

On Mon, May 14, 2012 at 5:30 PM, Mariano Martinez Peck <[hidden email]> wrote:


On Mon, May 14, 2012 at 10:19 PM, Martin Dias <[hidden email]> wrote:
Hi all

I have some methods receiving either a Class or a Trait instance as
parameter, so I usually call variables with names like
'aClassOrTrait'. Searching for a more synthetic name, I wonder if
'aBehavior' would be fine.

+1. For all my code that can handle both, traits and classes, I ALWAYS use the word Behavior rather than class.

Problem is that aTrait isBehavior -> false. But I think it is an implementative details and I don't like it. As you say, a trait for me is a behevior and therefore I use that word.

 

But IMO these examples show contradictions:

- Trait *is* a behavior:

TBehaviorCategorization users --->  an IdentitySet(Class Trait)

TPureBehavior users ---> an IdentitySet(TraitBehavior Behavior)
 (actually this makes me think 'aPureBehavior' is another alternative
for my variables)

- Trait is *not* a behavior:

TBehaviorCategorization isBehavior ---> false

TClassAndTraitDescription users ---> an IdentitySet(ClassDescription
TraitDescription)
 (I both are behaviors, why not call it TBehaviorDescription?)


Thanks in advance for your help.
Martín




--
Mariano
http://marianopeck.wordpress.com


Reply | Threaded
Open this post in threaded view
|

Re: is Trait a behavior?

tinchodias
Thanks!

Would be nice to unify some names in the metamodel.


On Mon, May 14, 2012 at 5:39 PM, Carla F. Griggio
<[hidden email]> wrote:

> +1
> I also want to distinct behavior objects from others and I need to include
> Traits in that criteria.
>
>
> On Mon, May 14, 2012 at 5:30 PM, Mariano Martinez Peck
> <[hidden email]> wrote:
>>
>>
>>
>> On Mon, May 14, 2012 at 10:19 PM, Martin Dias <[hidden email]>
>> wrote:
>>>
>>> Hi all
>>>
>>> I have some methods receiving either a Class or a Trait instance as
>>> parameter, so I usually call variables with names like
>>> 'aClassOrTrait'. Searching for a more synthetic name, I wonder if
>>> 'aBehavior' would be fine.
>>
>>
>> +1. For all my code that can handle both, traits and classes, I ALWAYS use
>> the word Behavior rather than class.
>>
>> Problem is that aTrait isBehavior -> false. But I think it is an
>> implementative details and I don't like it. As you say, a trait for me is a
>> behevior and therefore I use that word.
>>
>>
>>>
>>>
>>> But IMO these examples show contradictions:
>>>
>>> - Trait *is* a behavior:
>>>
>>> TBehaviorCategorization users --->  an IdentitySet(Class Trait)
>>>
>>> TPureBehavior users ---> an IdentitySet(TraitBehavior Behavior)
>>>  (actually this makes me think 'aPureBehavior' is another alternative
>>> for my variables)
>>>
>>> - Trait is *not* a behavior:
>>>
>>> TBehaviorCategorization isBehavior ---> false
>>>
>>> TClassAndTraitDescription users ---> an IdentitySet(ClassDescription
>>> TraitDescription)
>>>  (I both are behaviors, why not call it TBehaviorDescription?)
>>>
>>>
>>> Thanks in advance for your help.
>>> Martín
>>>
>>
>>
>>
>> --
>> Mariano
>> http://marianopeck.wordpress.com
>>
>

Reply | Threaded
Open this post in threaded view
|

Re: is Trait a behavior?

Denis Kudriashov
In reply to this post by tinchodias
Hello

2012/5/15 Martin Dias <[hidden email]>
Hi all

I have some methods receiving either a Class or a Trait instance as
parameter, so I usually call variables with names like
'aClassOrTrait'. Searching for a more synthetic name, I wonder if
'aBehavior' would be fine.


But
Trait isKindOf: Class => true

So why "aClass" is not good for you?



So aClass is bad

Reply | Threaded
Open this post in threaded view
|

Re: is Trait a behavior?

tinchodias
Hello

> But
> Trait isKindOf: Class => true
>
> So why "aClass" is not good for you?

But I was talking of Trait "instances", like TPureBehavior or
TBehaviorCategorization.

TPureBehavior isKindOf: Class => false
TBehaviorCategorization isKindOf: Class => false