Thanks Lukas, that is what I am doing now for our exports to text
files as well as some custom XML to send to specific web services.
Basically, we just wrote a writer that visits the object hierarchy in
the way we want and calls the appropriate visit methods. This is
similar to some things I have seen in Pier.
I am less worried about that part as I am the design of my actual
descriptions and how easy it will be to read/write into these formats
without writing too much manual stuff. In other words, I don't want to
write separate ways of handling different kinds of objects, I want
descriptions that fit all the object types I have.
As far as I have tested, this is relatively simple. It's just in my
experience going down these roads, you write about 90% then comes an
uh-oh moment if you are not careful. I am most interested in how
others have done similar things as well as affirmation of my ideas.
In any case, glad to hear that it is certainly possible/practical.
Quoting Lukas Renggli <renggli(a)iam.unibe.ch>ch>:
Are your descriptions going to still be relevant for
PDF in the same
way they are for a web page? Magritte descriptions usually provide a
GUI for entering or editing them, no?
Not sure if we're talking about the same things totally. My
descriptions have little if anything to do with the GUI. I am looking
at adding automagic form generation in a few places, but mainly the
forms in my application are hand-crafted right now. We do use Magritte
in conjunction with our forms (ex: memento validation), just not to
generate the actual form UI.
It is easy to generate dumps of described objects to specific output
formats. It is almost too simple to show a text exporter here:
aModel description do: [ :desc |
aStream
nextPutAll: (desc label);
nextPutAll: ’: ’;
nextPutAll: (desc toString: (desc accessor readFrom: aModel));
cr ]
For a description of this example see page 6 in
http://www.iam.unibe.ch/~scg/Archive/Papers/Reng07aMagritte.pdf
.
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch
_______________________________________________
SmallWiki, Magritte, Pier and Related Tools ...
https://www.iam.unibe.ch/mailman/listinfo/smallwiki