← Back to team overview

oship-dev team mailing list archive

Generic types in the OpenEHR specs

 

I'm working in the EHR IM and I realized that would be interesting to have
some parts of the common IM implemented to test some classes of the EHR IM,
like the VersionedComposition and VersionedEhrAccess. I was studying about
the common IM and I have some doubts about how we will implement it. The
versioning classes in the openEHR specification use generic types. For
example, they have the classes Version<T> and Versioned_Object<T>. In Java
this is a very important thing, but will we use these generic types in
Python? It seems that the implementation of a Versioned_Composition will
just be a class that inherit from Versioned_Object.

Versioned_Object has a lot of methods which have parameters with generic
types. But can we specify the type of a method parameter in a zope
Interface? For example, is the example below valid in a interface?

def method(param=Object(schema=ISomeInterface))
"""..."""

I looked for some example like that, but I couldn't find anything. I think
this just would define a default value to the param.

I think these generic types aren't so useful when we are using dynamic
typing. What do you think about?

Cheers,

Wagner F. Mezaroba.