[Zope3-dev] Re: Schemas, Fields and Fieldsets
Phillip J. Eby
pje@telecommunity.com
Fri, 28 Mar 2003 12:28:43 -0500
At 12:33 PM 3/28/03 -0300, Sidnei da Silva wrote:
><big snip>
>
>On a related subject, I would like to know if there is any plan for
>using a standard XML format for defining schema in Zope3.
Actually, if we're going to use a standard format, I'd like to put in a
plug for the OMG MOF, which just happens to have a standard XML interchange
format, XMI.
The MOF (Meta-Object Facility) is the metamodel for UML, CORBA, and other
OMG standards such as CWM (Common Warehouse Metamodel - used for exchanging
relational database schemas, warehouse transforms, and other goodies).
I will admit that MOF doesn't have any built-in mechanism for dealing with
fieldsets or UI representations. However, like UML it includes the notion
of tagged values, that can be applied to classes and their attributes,
methods, exceptions, etc. So a set of 'org.zope.schemas.*' tagged values
could be agreed upon for such things.
PEAK has an implementation of MOF 1.3.1 available; writing it mostly
consisted of straightforward transcription from the specification
document. And, because PEAK has a code generator which can create Python
code from MOF models, I can trivially generate a similar implementation for
any version of UML or CWM for which there exists an XMI document describing
its metamodel. So, if Zope used MOF-based schemas, the same could be done
with them.
When I finish adding the ability to write XMI files from arbitrary models,
I intend to start work on CWM->SQL generation as part of this overall
MOF/XMI toolchain. Potentially, this could mean SQL generation from Zope
schemas, if they are in the same overall conceptual ballpark. And, perhaps
also useful, UML -> Zope schema generation. PEAK can currently read UML
1.3 or UML 1.4 models expressed as XMI 1.0 or 1.1, and represent the model
as in-memory objects, so if Zope schemas were a subset (or
stereotype/tagged value superset) of UML, that could work too.