E&S CVS Commit: PEAK - More TypeCode bootstrapping. Enumeration and DataType can now generate

pje at eby-sarna.com pje at eby-sarna.com
Mon Feb 10 21:19:01 EST 2003


Module Name:	PEAK
Committed By:	pje
Date:		Tue Feb 11 02:18:32 UTC 2003

Modified Files:
	PEAK/src/peak/metamodels: MOF131.py
	PEAK/src/peak/model: datatypes.py enumerations.py structural.py

Log Message:
More TypeCode bootstrapping.  Enumeration and DataType can now generate
their own TypeCode values (as 'mdl_typeCode'), Primitive defaults to
'tk_any', and all other Classifier subclasses default to a type kind
of 'tk_objref'.  Of course, to be useful, primitive types should be set
to an appropriate CORBA typecode for efficient and type-safe XMI rendering.
Also, made TypeCodes repr()-able for debugging, and did some more cleanup
to catch MOF131 up to the current state of peak.model.

I think maybe we should add some additional primitive datatypes for ease of
model definition; perhaps such that 'String(30)' actually gives you an
object whose mdl_typeCode is 'TypeCode(kind=TCKind.tk_string,length=30)'.
That's a somewhat radical interpretation of what a PrimitiveType is,
however.  I'll need to give it some thought.

I've also been thinking that it would be nice to be able to put some XMI
helper code into the peak.model base classes.  But the problem with that is
that it's too likely to be dependent on XMI versions, and will scatter the
XMI implementation all over creation.  This is definitely the sort of thing
AOP was intended to solve, but frankly PEAK's AOP capabilities suck.  I
think that instead, some kind of adaptation mechanism is needed.  I wonder
if I could create some kind of AdapterDM for this purpose?


To view diffs of this commit, you can use the following URL(s):
http://cvs.eby-sarna.com/PEAK/src/peak/metamodels/MOF131.py.diff?r1=1.6&r2=1.7
http://cvs.eby-sarna.com/PEAK/src/peak/model/datatypes.py.diff?r1=1.5&r2=1.6
http://cvs.eby-sarna.com/PEAK/src/peak/model/enumerations.py.diff?r1=1.2&r2=1.3
http://cvs.eby-sarna.com/PEAK/src/peak/model/structural.py.diff?r1=1.20&r2=1.21

To generate a diff of this commit:
cvs rdiff -r1.6 -r1.7 PEAK/src/peak/metamodels/MOF131.py
cvs rdiff -r1.5 -r1.6 PEAK/src/peak/model/datatypes.py
cvs rdiff -r1.2 -r1.3 PEAK/src/peak/model/enumerations.py
cvs rdiff -r1.20 -r1.21 PEAK/src/peak/model/structural.py

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.




More information about the source-changes mailing list