[Smtk-developers] Follow-up on resource metadata
TJ Corona
tj.corona at kitware.com
Wed Nov 15 10:06:32 EST 2017
> On Nov 15, 2017, at 10:03 AM, David Thompson <david.thompson at kitware.com> wrote:
>
> Hi TJ,
>
>>>> ... We could definitely subclass Metadata, but I don’t see why we need to. Currently, the create(), read() and write() functors are public fields that can be reassigned (once operators are more decoupled from smtk::model, they should become operators); as such, I don’t see any benefit to subclassing.
>>>
>>> My point is that every model resource should override create/read/write with the same 3 functors. It would be nice to inherit them.
>>
>> I’m not sure I follow. If we assume that the three functors are instead smtk::operator::Operators (which is my intention, as soon as smtk::operator::* is usable), then these three operators will need to be explicitly provided by whoever registers the resource.
>
> But at least the read and write operators will be the same for all: read = "load smtk model", write = "save smtk model". I thought that we agreed native model files would be handled by import/export operators.
Ah, gotcha. That’s a pretty good reason to subclass Metadata for model resources.
More information about the Smtk-developers
mailing list