describing a complex data types with Magritte

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

describing a complex data types with Magritte

Igor Stasenko
Hello list,

I'm trying to describe a model, which values could have complex or
multiple types at once.

In general , a question is how to provide a description of following fields:

suppose you have a field, which in own turn having own fields, and you
want to display them in-line i.e.

position ::  point(x,y)

point::x  = integer
point::y = integer

so i'd like to describe a position, as a compound data type, lets say,
instances of class Point which having own fields (x,y).
So, then in form i could have this field displayed like following:

position x: [ ... ] y: [ ...]

Another case, is when value can use multiple types.
Following previous example, for position, now i reconsidered and want
a position accept not only instances of Point, but instances of
Point3D as well.
So, then Magritte should be able to display my 'position' field editor
like following:

position
*   x: [ ... ] y: [ ...]
*   x: [ ... ] y: [ ...] z: [...]

where * is radio button.
Or there can be different view where user can select a type first, and
then edit value:

position [<type selection combobox>]  [ value editor for selected type ]

I don't want to get into detail how to render/build such editors, my
main question, is how to describe such things in less
painfull/controversial way using Magritte.

--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: describing a complex data types with Magritte

Philippe Marschall
2009/1/23, Igor Stasenko <[hidden email]>:

> Hello list,
>
> I'm trying to describe a model, which values could have complex or
> multiple types at once.
>
> In general , a question is how to provide a description of following fields:
>
> suppose you have a field, which in own turn having own fields, and you
> want to display them in-line i.e.
>
> position ::  point(x,y)
>
> point::x  = integer
> point::y = integer
>
> so i'd like to describe a position, as a compound data type, lets say,
> instances of class Point which having own fields (x,y).
> So, then in form i could have this field displayed like following:
>
> position x: [ ... ] y: [ ...]
>
> Another case, is when value can use multiple types.
> Following previous example, for position, now i reconsidered and want
> a position accept not only instances of Point, but instances of
> Point3D as well.
> So, then Magritte should be able to display my 'position' field editor
> like following:
>
> position
> *   x: [ ... ] y: [ ...]
> *   x: [ ... ] y: [ ...] z: [...]
>
> where * is radio button.
> Or there can be different view where user can select a type first, and
> then edit value:
>
> position [<type selection combobox>]  [ value editor for selected type ]
>
> I don't want to get into detail how to render/build such editors, my
> main question, is how to describe such things in less
> painfull/controversial way using Magritte.

MARelationDescription new
    selectorAccessor: #position;
    classes: (Array with: Point with: Point3D);
    yourself

of course Point and Point3D need to be described with Magritte.

Cheers
Philippe

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: describing a complex data types with Magritte

Philippe Marschall
2009/1/24, Philippe Marschall <[hidden email]>:

> 2009/1/23, Igor Stasenko <[hidden email]>:
>> Hello list,
>>
>> I'm trying to describe a model, which values could have complex or
>> multiple types at once.
>>
>> In general , a question is how to provide a description of following
>> fields:
>>
>> suppose you have a field, which in own turn having own fields, and you
>> want to display them in-line i.e.
>>
>> position ::  point(x,y)
>>
>> point::x  = integer
>> point::y = integer
>>
>> so i'd like to describe a position, as a compound data type, lets say,
>> instances of class Point which having own fields (x,y).
>> So, then in form i could have this field displayed like following:
>>
>> position x: [ ... ] y: [ ...]
>>
>> Another case, is when value can use multiple types.
>> Following previous example, for position, now i reconsidered and want
>> a position accept not only instances of Point, but instances of
>> Point3D as well.
>> So, then Magritte should be able to display my 'position' field editor
>> like following:
>>
>> position
>> *   x: [ ... ] y: [ ...]
>> *   x: [ ... ] y: [ ...] z: [...]
>>
>> where * is radio button.
>> Or there can be different view where user can select a type first, and
>> then edit value:
>>
>> position [<type selection combobox>]  [ value editor for selected type ]
>>
>> I don't want to get into detail how to render/build such editors, my
>> main question, is how to describe such things in less
>> painfull/controversial way using Magritte.
>
> MARelationDescription new
>     selectorAccessor: #position;
>     classes: (Array with: Point with: Point3D);
>     yourself
>
> of course Point and Point3D need to be described with Magritte.

That should be MAToOneRelationDescription not MARelationDescription.

Cheers
Philippe

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: describing a complex data types with Magritte

Igor Stasenko
2009/1/24 Philippe Marschall <[hidden email]>:

> 2009/1/24, Philippe Marschall <[hidden email]>:
>> 2009/1/23, Igor Stasenko <[hidden email]>:
>>> Hello list,
>>>
>>> I'm trying to describe a model, which values could have complex or
>>> multiple types at once.
>>>
>>> In general , a question is how to provide a description of following
>>> fields:
>>>
>>> suppose you have a field, which in own turn having own fields, and you
>>> want to display them in-line i.e.
>>>
>>> position ::  point(x,y)
>>>
>>> point::x  = integer
>>> point::y = integer
>>>
>>> so i'd like to describe a position, as a compound data type, lets say,
>>> instances of class Point which having own fields (x,y).
>>> So, then in form i could have this field displayed like following:
>>>
>>> position x: [ ... ] y: [ ...]
>>>
>>> Another case, is when value can use multiple types.
>>> Following previous example, for position, now i reconsidered and want
>>> a position accept not only instances of Point, but instances of
>>> Point3D as well.
>>> So, then Magritte should be able to display my 'position' field editor
>>> like following:
>>>
>>> position
>>> *   x: [ ... ] y: [ ...]
>>> *   x: [ ... ] y: [ ...] z: [...]
>>>
>>> where * is radio button.
>>> Or there can be different view where user can select a type first, and
>>> then edit value:
>>>
>>> position [<type selection combobox>]  [ value editor for selected type ]
>>>
>>> I don't want to get into detail how to render/build such editors, my
>>> main question, is how to describe such things in less
>>> painfull/controversial way using Magritte.
>>
>> MARelationDescription new
>>     selectorAccessor: #position;
>>     classes: (Array with: Point with: Point3D);
>>     yourself
>>
>> of course Point and Point3D need to be described with Magritte.
>
> That should be MAToOneRelationDescription not MARelationDescription.
>
Thanks, Philippe

> Cheers
> Philippe
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: describing a complex data types with Magritte

Igor Stasenko
Another question,
what if i want from user to be able to choose one of possible values:

* string 'foo'
* string 'bar'
* instance of Point (and if choosen, ask to enter x,y values)

how i can describe that?

2009/1/24 Igor Stasenko <[hidden email]>:

> 2009/1/24 Philippe Marschall <[hidden email]>:
>> 2009/1/24, Philippe Marschall <[hidden email]>:
>>> 2009/1/23, Igor Stasenko <[hidden email]>:
>>>> Hello list,
>>>>
>>>> I'm trying to describe a model, which values could have complex or
>>>> multiple types at once.
>>>>
>>>> In general , a question is how to provide a description of following
>>>> fields:
>>>>
>>>> suppose you have a field, which in own turn having own fields, and you
>>>> want to display them in-line i.e.
>>>>
>>>> position ::  point(x,y)
>>>>
>>>> point::x  = integer
>>>> point::y = integer
>>>>
>>>> so i'd like to describe a position, as a compound data type, lets say,
>>>> instances of class Point which having own fields (x,y).
>>>> So, then in form i could have this field displayed like following:
>>>>
>>>> position x: [ ... ] y: [ ...]
>>>>
>>>> Another case, is when value can use multiple types.
>>>> Following previous example, for position, now i reconsidered and want
>>>> a position accept not only instances of Point, but instances of
>>>> Point3D as well.
>>>> So, then Magritte should be able to display my 'position' field editor
>>>> like following:
>>>>
>>>> position
>>>> *   x: [ ... ] y: [ ...]
>>>> *   x: [ ... ] y: [ ...] z: [...]
>>>>
>>>> where * is radio button.
>>>> Or there can be different view where user can select a type first, and
>>>> then edit value:
>>>>
>>>> position [<type selection combobox>]  [ value editor for selected type ]
>>>>
>>>> I don't want to get into detail how to render/build such editors, my
>>>> main question, is how to describe such things in less
>>>> painfull/controversial way using Magritte.
>>>
>>> MARelationDescription new
>>>     selectorAccessor: #position;
>>>     classes: (Array with: Point with: Point3D);
>>>     yourself
>>>
>>> of course Point and Point3D need to be described with Magritte.
>>
>> That should be MAToOneRelationDescription not MARelationDescription.
>>
> Thanks, Philippe
>
>> Cheers
>> Philippe
>>
>> _______________________________________________
>> SmallWiki, Magritte, Pier and Related Tools ...
>> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>>
>
>
>
> --
> Best regards,
> Igor Stasenko AKA sig.
>



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: describing a complex data types with Magritte

keith1y
Igor Stasenko wrote:
> Another question,
> what if i want from user to be able to choose one of possible values:
>
> * string 'foo'
> * string 'bar'
> * instance of Point (and if choosen, ask to enter x,y values)
>  
Your point class needs to have a description of its own, i.e.
descriptionX descriptionY.

Then when an edit form is presented it will be built from the descriptions

Keith

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: describing a complex data types with Magritte

Igor Stasenko
2009/1/24 Keith Hodges <[hidden email]>:

> Igor Stasenko wrote:
>> Another question,
>> what if i want from user to be able to choose one of possible values:
>>
>> * string 'foo'
>> * string 'bar'
>> * instance of Point (and if choosen, ask to enter x,y values)
>>
> Your point class needs to have a description of its own, i.e.
> descriptionX descriptionY.
>
> Then when an edit form is presented it will be built from the descriptions
>
exactly, except one little thing: how i can tell that it accepts
either 'foo' or 'bar' or instance of Point?
MASingleOptionDescription?

> Keith
>
> _______________________________________________
> SmallWiki, Magritte, Pier and Related Tools ...
> https://www.iam.unibe.ch/mailman/listinfo/smallwiki
>



--
Best regards,
Igor Stasenko AKA sig.

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki
Reply | Threaded
Open this post in threaded view
|

Re: describing a complex data types with Magritte

Philippe Marschall
In reply to this post by Igor Stasenko
2009/1/24, Igor Stasenko <[hidden email]>:
> Another question,
> what if i want from user to be able to choose one of possible values:
>
> * string 'foo'
> * string 'bar'
> * instance of Point (and if choosen, ask to enter x,y values)
>
> how i can describe that?

You have to make you own description that is a bit like
MASingleOptionDescription and a bit like MAToOneRelationDescription.
And a matching editor as well. That requires you to wrap your head
around Magritte visitors but once you're done you know everything
there is to know about Magritte.

Cheers
Philippe

_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki