Non-moose entities in Moose

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

Non-moose entities in Moose

Uko2
Hi everyone.

Does anybody has a suggestion of how to work with objects which classes do not subclass Moose entity? For example I need a Date as one of the properties. Is there a common solution for that?

Cheers
Uko
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Non-moose entities in Moose

Nicolas Anquetil

depends what you want to do with them?

you can always just store them in properties (like the values of a
metric) no ?

nicolas

On 11/07/2013 07:04 PM, Yuriy Tymchuk wrote:

> Hi everyone.
>
> Does anybody has a suggestion of how to work with objects which classes do not subclass Moose entity? For example I need a Date as one of the properties. Is there a common solution for that?
>
> Cheers
> Uko
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
Nicolas Anquetil -- RMod research team (Inria)

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Non-moose entities in Moose

Uko2
Is there something special I should do for it?

Because I’ve added pragma like:
<MSEProperty: #date type: #Date>
To the parent entity

uko

On 07 Nov 2013, at 19:12, Nicolas Anquetil <[hidden email]> wrote:

>
> depends what you want to do with them?
>
> you can always just store them in properties (like the values of a metric) no ?
>
> nicolas
>
> On 11/07/2013 07:04 PM, Yuriy Tymchuk wrote:
>> Hi everyone.
>>
>> Does anybody has a suggestion of how to work with objects which classes do not subclass Moose entity? For example I need a Date as one of the properties. Is there a common solution for that?
>>
>> Cheers
>> Uko
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> Nicolas Anquetil -- RMod research team (Inria)
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Non-moose entities in Moose

Andre Hora



On Thu, Nov 7, 2013 at 7:25 PM, Yuriy Tymchuk <[hidden email]> wrote:
Is there something special I should do for it?

Because I’ve added pragma like:
<MSEProperty: #date type: #Date>
To the parent entity
I think this is wrong. 

The type should be either primitive property defined in Fame (#Boolean, #Number, #String) or a class of your meta-model (FAMIXClass, FAMIXMethod, etc).

A simple solution is use the type #Number, and convert the date to a number, for example using:
Date today asDateAndTime asUnixTime. "1383778800"
(DateAndTime fromUnixTime: 1383778800) asDate " 7 November 2013"

Maybe there is another solution that I'm not aware :)
 

uko

On 07 Nov 2013, at 19:12, Nicolas Anquetil <[hidden email]> wrote:

>
> depends what you want to do with them?
>
> you can always just store them in properties (like the values of a metric) no ?
>
> nicolas
>
> On 11/07/2013 07:04 PM, Yuriy Tymchuk wrote:
>> Hi everyone.
>>
>> Does anybody has a suggestion of how to work with objects which classes do not subclass Moose entity? For example I need a Date as one of the properties. Is there a common solution for that?
>>
>> Cheers
>> Uko
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> Nicolas Anquetil -- RMod research team (Inria)
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--
Andre Hora

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Non-moose entities in Moose

abergel
In reply to this post by Uko2
You need maybe to reset the meta tower.
Try to execute:

        MooseModel resetMeta

Alexandre


On Nov 7, 2013, at 3:25 PM, Yuriy Tymchuk <[hidden email]> wrote:

> Is there something special I should do for it?
>
> Because I’ve added pragma like:
> <MSEProperty: #date type: #Date>
> To the parent entity
>
> uko
>
> On 07 Nov 2013, at 19:12, Nicolas Anquetil <[hidden email]> wrote:
>
>>
>> depends what you want to do with them?
>>
>> you can always just store them in properties (like the values of a metric) no ?
>>
>> nicolas
>>
>> On 11/07/2013 07:04 PM, Yuriy Tymchuk wrote:
>>> Hi everyone.
>>>
>>> Does anybody has a suggestion of how to work with objects which classes do not subclass Moose entity? For example I need a Date as one of the properties. Is there a common solution for that?
>>>
>>> Cheers
>>> Uko
>>> _______________________________________________
>>> Moose-dev mailing list
>>> [hidden email]
>>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>>
>> --
>> Nicolas Anquetil -- RMod research team (Inria)
>>
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev

--
_,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:
Alexandre Bergel  http://www.bergel.eu
^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;._,.;:~^~:;.




_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Non-moose entities in Moose

Tudor Girba-2
In reply to this post by Andre Hora
Exactly. The current solution would be to store the value as a memento from which you can build your real object afterwards. In the case of Date, this would be either a number or a string.

Doru


On Thu, Nov 7, 2013 at 7:58 PM, Andre Hora <[hidden email]> wrote:



On Thu, Nov 7, 2013 at 7:25 PM, Yuriy Tymchuk <[hidden email]> wrote:
Is there something special I should do for it?

Because I’ve added pragma like:
<MSEProperty: #date type: #Date>
To the parent entity
I think this is wrong. 

The type should be either primitive property defined in Fame (#Boolean, #Number, #String) or a class of your meta-model (FAMIXClass, FAMIXMethod, etc).

A simple solution is use the type #Number, and convert the date to a number, for example using:
Date today asDateAndTime asUnixTime. "1383778800"
(DateAndTime fromUnixTime: 1383778800) asDate " 7 November 2013"

Maybe there is another solution that I'm not aware :)
 

uko

On 07 Nov 2013, at 19:12, Nicolas Anquetil <[hidden email]> wrote:

>
> depends what you want to do with them?
>
> you can always just store them in properties (like the values of a metric) no ?
>
> nicolas
>
> On 11/07/2013 07:04 PM, Yuriy Tymchuk wrote:
>> Hi everyone.
>>
>> Does anybody has a suggestion of how to work with objects which classes do not subclass Moose entity? For example I need a Date as one of the properties. Is there a common solution for that?
>>
>> Cheers
>> Uko
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> Nicolas Anquetil -- RMod research team (Inria)
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--
Andre Hora

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev
Reply | Threaded
Open this post in threaded view
|

Re: Non-moose entities in Moose

Uko2

On 07 Nov 2013, at 21:48, Tudor Girba <[hidden email]> wrote:

Exactly. The current solution
What is the other possible situation?


would be to store the value as a memento from which you can build your real object afterwards. In the case of Date, this would be either a number or a string.

Doru


On Thu, Nov 7, 2013 at 7:58 PM, Andre Hora <[hidden email]> wrote:



On Thu, Nov 7, 2013 at 7:25 PM, Yuriy Tymchuk <[hidden email]> wrote:
Is there something special I should do for it?

Because I’ve added pragma like:
<MSEProperty: #date type: #Date>
To the parent entity
I think this is wrong. 

The type should be either primitive property defined in Fame (#Boolean, #Number, #String) or a class of your meta-model (FAMIXClass, FAMIXMethod, etc).

A simple solution is use the type #Number, and convert the date to a number, for example using:
Date today asDateAndTime asUnixTime. "1383778800"
(DateAndTime fromUnixTime: 1383778800) asDate " 7 November 2013"

Maybe there is another solution that I'm not aware :)
 

uko

On 07 Nov 2013, at 19:12, Nicolas Anquetil <[hidden email]> wrote:

>
> depends what you want to do with them?
>
> you can always just store them in properties (like the values of a metric) no ?
>
> nicolas
>
> On 11/07/2013 07:04 PM, Yuriy Tymchuk wrote:
>> Hi everyone.
>>
>> Does anybody has a suggestion of how to work with objects which classes do not subclass Moose entity? For example I need a Date as one of the properties. Is there a common solution for that?
>>
>> Cheers
>> Uko
>> _______________________________________________
>> Moose-dev mailing list
>> [hidden email]
>> https://www.iam.unibe.ch/mailman/listinfo/moose-dev
>
> --
> Nicolas Anquetil -- RMod research team (Inria)
>
> _______________________________________________
> Moose-dev mailing list
> [hidden email]
> https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev



--
Andre Hora

_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev




--

"Every thing has its own flow"
_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev


_______________________________________________
Moose-dev mailing list
[hidden email]
https://www.iam.unibe.ch/mailman/listinfo/moose-dev