For most simple descriptions, streaming the value is just a matter
of
rendering the value according to the description using the normal
visitor pattern. However, MAFileModel is a full-blown class and
doesn't have a corresponding description to guide the process.
Yes, MAFileDescription is sort of a primitive type, mainly because in
the user interface it appears as a single upload/download field.
What would be the most interesting path here: add the required
descriptions to the classes or just go ahead and stream the
attributes?
I guess it would make sense to add these descriptions as a class
extension. This is one of most useful techniques of Magritte, that you
can attach new descriptions to any class in the system. I use this all
the time.
It seems to me that the second options make the Json visitor to
tightly coupled to the MAFileModel class. On the other hand, adding
the descriptions may not be that interesting because it would mean
changing a Magritte base class.
I don't know if it makes sense to add these descriptions to the core
at the moment?
Cheers,
Lukas
--
Lukas Renggli
http://www.lukas-renggli.ch