Re: Formal review of "Output Formatters" library begins today

Vladimir Prus wrote:
A particularly interesting question is how the proposed library overlaps with serialization. When outputting vector<Function> I'd prefer the content of 'Function' to be outputted too, preferably by describing the members with the 'serialize' method. And the question is if I can use outfmt library, or have to use the serialization library? The serialization library is pretty large, so, I'd like outfmt to be able to output UDT which have 'serialize' defined. IMO, vector<some_UDT> is a very common case, maybe even more common than vector<pair<int, int> >.
If one had nothing else to do, he could make a derivation of one of the existing archives (e.g. text_archive) that would "annotate" the serialization. This might be useful for debugging or other purposes. On the other hand, I just use the xml_archive for that purpose now and its fine (although a little verbose). It also plays nice with XML browsing tools. So that's handy. My real observation is that I see this as orthogonal to serialization and that it should remain that way. I don't seen any real overlap now except that there might be a couple of instances where either one might do. I think even these would be rare cases. I would resist any idea to intertwine these concepts. Robert Ramey

Robert Ramey wrote:
Vladimir Prus wrote:
A particularly interesting question is how the proposed library overlaps with serialization. When outputting vector<Function> I'd prefer the content of 'Function' to be outputted too, preferably by describing the members with the 'serialize' method. And the question is if I can use outfmt library, or have to use the serialization library? The serialization library is pretty large, so, I'd like outfmt to be able to output UDT which have 'serialize' defined. IMO, vector<some_UDT> is a very common case, maybe even more common than vector<pair<int, int> >.
If one had nothing else to do, he could make a derivation of one of the existing archives (e.g. text_archive) that would "annotate" the serialization.
It's possible, but the simple-minded "output_operator_helper_which_uses_the_serialize" method will be very simple and have much less dependencies than "text_archive".
This might be useful for debugging or other purposes. On the other hand, I just use the xml_archive for that purpose now and its fine (although a little verbose). It also plays nice with XML browsing tools. So that's handy.
Yes, it's a little verbose.
My real observation is that I see this as orthogonal to serialization and that it should remain that way. I don't seen any real overlap now except that there might be a couple of instances where either one might do. I think even these would be rare cases. I would resist any idea to intertwine these concepts.
I'm lost. What are "these concepts"? What I propose is that the "serialize" method be usable by the outfmt library to generate more usable output. No other link between the two libraries is suggested. - Volodya

My real observation is that I see this as orthogonal to serialization and that it should remain that way. I don't seen any real overlap now except that there might be a couple of instances where either one might do. I think even these would be rare cases. I would resist any idea to intertwine these concepts.
I'm lost. What are "these concepts"? What I propose is that the "serialize" method be usable by the outfmt library to generate more usable output. No other link between the two libraries is suggested.
I assume you suggest something like: - if an object can be serialized, use that for output - if not, use default (operator<<) This seems ok to me. Reece? Best, John -- John Torjo -- john@torjo.com Contributing editor, C/C++ Users Journal -- "Win32 GUI Generics" -- generics & GUI do mix, after all -- http://www.torjo.com/win32gui/ -- v1.4.0 - save_dlg - true binding of your data to UI controls! + easily add validation rules (win32gui/examples/smart_dlg)

John Torjo wrote:
My real observation is that I see this as orthogonal to serialization and that it should remain that way. I don't seen any real overlap now except that there might be a couple of instances where either one might do. I think even these would be rare cases. I would resist any idea to intertwine these concepts.
I'm lost. What are "these concepts"? What I propose is that the "serialize" method be usable by the outfmt library to generate more usable output. No other link between the two libraries is suggested.
I assume you suggest something like: - if an object can be serialized, use that for output - if not, use default (operator<<)
This depends on the meaning of "can be serialized". If that means, "has the method 'serialize'", then right, I suggest to use it. If that mean using the serialization library (say, text_archive or xml_archive), then no. I'd like to use outfmt without including all serializaton headers. I want to be able to output all of my classes, and I don't want to include serialization headers in all of my own headers. - Volodya
participants (3)
-
John Torjo
-
Robert Ramey
-
Vladimir Prus