perl-unicode

Re: Metadata interface - guts

1998-10-26 21:47:15
Chip Salzenberg writes:
According to Ken Fox:
The question is what methods does core need to talk to metadata magic?
How about these for a start:

  meta -- support regex searches with metadata qualifiers

I suspect you mean "search" or "query" here.

Actually I thought this could be the metadata magic object's core
implementation of the meta() operator.  The regex engine only needs
meta() to figure out metadata context.  meta() has to be *fast*.

  after_change -- sync metadata with data changes

Did you expect after_change() to take parameters indicating what range
was replaced with what new range?  I think that's relevant.  :-)

I was just thinking out loud.  I suspect that after_change() will need
to take an OP or some other command object.  One of the cool things about
metadata is that it gives us a hook to put in a history feature.  Pretty
nice for debugging -- maybe even partial support for reverse execution.

  serialize -- let metadata be saved to disk or sent across network

I'd prefer a "first/next" interface that would allow multiple
encodings.

I was thinking the "first/next" interface would be part of the metadata
iterator system.  Once we get a metadata object though, it might be nice
to convert one to a portable format.  I'm kind of hoping that everything
will have a serialize() method.

We might need to invent a couple terms here too.  I'm thinking of a
metadata management object -- one for each scalar that has metadata --
that manages metadata objects.  These are fly-weight objects that hold
attributes that apply to a particular range.  Layered on top of this are
the user-level metadata semantics, which map the fly-weight objects into
HTML for example.  The core will have to hold everything together.
For example, it might have to manage several metadata managers on a
single scalar.

I think there's enough flexibility in something like this to implement
both in-line and out-of-band mark-up.  Chip's meta() proposal is
definitely worth coding up.

- Ken

-- 
Ken Fox, kfox(_at_)ford(_dot_)com, (313)59-44794
------------------------------------------------------------------------
Ford Motor Company, Powertrain           | "Is this some sort of trick
Analytical Powertrain Methods Department |  question or what?" -- Calvin
C3P Implementation Section               |