Hi,

I'm trying to wrap my head around Magritte but I am failing hard...

Imagine I have object with three attributes.

~~~~~~~~~~~~~~~~~~~
Object subclass: #Person
instanceVariableNames: 'name age email'
~~~~~~~~~~~~~~~~~~~

Now the normal way would be to add magritte descriptions...

~~~~~~~~~~~~~~~~~~~
Person>>descriptionEmail
<magritteDescription>
    ^ MAStringDescription new
        label: 'Email';
        accessor: #email;
        beRequired;
        yourself
~~~~~~~~~~~~~~~~~~~
etc for the rest...


And now if I want to manipulate it I would do...
~~~~~~~~~~~~~~~~~~~
|p|
p := Person new name: 'Someone'; email: 's...@one.com'; age: 20.
p asMagritteMorph addButtons; openInWindow.
~~~~~~~~~~~~~~~~~~~

So far so simple... however what I don't understand:

1. What if I want to have different descriptions for the same attribute?
For example in some views the email is required and in others it is not.

2. Must the description be part of the object?
Maybe I am still not fully committed to the having massive protocols
with tons of extension methods instead of externalizing the code to
separate adapters and whatnot.

3. What if I want only partial rendering?
For example in one view I want to be able to edit only name and age,
and in another one all three.
Since #asMagritteMorph collects everything I don't see how I can customize this.

Now I do expect that all these things are possible, however as I'm
just starting with Magritte it's a lot of information and concepts to
absorb... so any help is appreciated.

Also, is there maintained Magritte-Spec? I've seen something by Sean,
but it's from 2013 with a single-ish commit.

Thanks,
Peter

Reply via email to