Deb Lewis
2006-Jul-18 16:43 UTC
[Masterview-devel] Another idea for the single file format for directives
Jeff - I like the notion of having a standard DirectiveInfo meta-info class
to associate with a directive implementation, which provides a standard
approach for expressing the interesting metadata for a directive: version,
description, optional category. As you say, that then gives us a clean way
to drive other interesting tools (admin views of loaded directives, doc
generation, etc)
Not sure if I like having the example bundled into the core runtime class.
Maybe example (and even description) are better done by a sibling class,
located by convention using name derived from that of the
ModName::DirectiveClass, e.g. ModName::DirectiveClassDoc to contain
supporting doc specifications?
Similar to scheme for packaging and locating test cases - my_directive.rb +
my_directive.rb pair of files.
Also include optional attribute_name in there, so that our implementation of
the standard class method attr_name on DirectiveBase can check for override
before dropping into default_attr_name backstop. (Or maybe that just all
migrates into DirectiveInfo as method #attr_name or #attribute_name; I
prefer the longer form, actually)
I''d also like a namespace attribute in there to provide the foundation
for
supporting multiple namespaces: #namespace_name. That would then be
exploited by our standard methods for forming fully-qualified attribute
names. Someone assembling a library of addons could then subclass
DirectiveInfo to install their own std namespace value and then use
MyCustomDirectiveLibraryDirectiveIinfo in their directives.
So directive protocol proposal: #directive_name returns the fully-qualified
name of the directive''s attribute; #attribute_name returns the simple
attribute name, #namespace_name returns the namespace prefix qualifier.
Maybe deprecate the original #full_attr_name currently in DirectiveBase,
would like to use method names that directly reflect XML namespace
terminology for qnames.
Believe we''ll also also need an override mechanism for namespaces in
the MV
config options, just as xmlns markup allows the usage site to override the
creator''s namespace in order to resolve namespace collisions in their
documents, but that would build on top of the basic facility.
~ Deb
_____
From: Jeff Barczewski [mailto:jeff.barczewski at gmail.com]
Sent: Monday, July 17, 2006 7:12 AM
To: masterview-devel at rubyforge.org; djlewis at acm.org
Subject: Another idea for the single file format for directives
We could use an inner class to hold the description and examples
class MyDirective
class MetaInfo
def description
...
end
def example
...
end
end
end
or even simply a Map to hold the pieces.
Just other ideas to add to the list.
-------------- next part --------------
An HTML attachment was scrubbed...
URL:
http://rubyforge.org/pipermail/masterview-devel/attachments/20060718/e19709f3/attachment-0001.html
Deb Lewis
2006-Jul-18 17:09 UTC
[Masterview-devel] Another idea for the single file format fordirectives
>>> Similar to scheme for packaging and locating test cases -my_directive.rb + my_directive.rb pair of files. ahh... that was meant to be: ... + test_my_directive.rb (or directive_FOO_test.rb for FOO.rb, per our own existing unit test file naming convention_ (use std prefix or suffix on the file containing the test case for the directive, ~ Deb -------------- next part -------------- An HTML attachment was scrubbed... URL: http://rubyforge.org/pipermail/masterview-devel/attachments/20060718/f465b080/attachment.html