sergio@lampada.uerj.br schreef:
Hi Bert,
Sergio Miranda Freire schreef:
purpose is a function that returns the value of the inherited name
attribute. It is implemented in the method purpose()
But there is no setter for it. It returns this.name, which is set in the
constructor.
But this seems wrong to me, because in the rm-builder the name of
property is demanded, that is why it is an annotated constructor.
I do not know if I understood what you meant. Why should we have a setter
for purpose if it is not an attribute of PartyIdentity, but is derived
from name which is set in the constructor of Locatable? Besides, purpose
is not a parameter of the constructor.
Thanks, Sergio, for thinking with me,
I think it should be in the constructor, because, reading the specs, it
is a required attribute, please take a look in
http://www.openehr.org/svn/specification/TAGS/Release-1.0.1/publishing/architecture/rm/demographic_im.pdf
It must be the same as "name", you are right, and "name" is an annotated
parameter in the constructor.
But the way it is now, we have a required attribute, which is with
another name (which is "name") in the constructor, this makes it
difficult to interpret ADL. Because people will use in ADL "purpose",
because they read the specs, and when the reference java kernel is used,
"purpose" in ADL must be mapped to "name"
Anyway, this must be in the rm-builder, which is also a part of the
ref_java_impl, because the rm-builder, maybe you did not take a look at
the code, simply said, uses archetype-input and data to construct an
RM-object (that why it is called the RM-builder). I would have called it
"rm-factory", but that is not important.
If you look at the code, you'll see it uses the annotated constructors
from the openehr-rm to get a definition of the rm-objects to build, and
it maps these constructors to the data given to the rm-builder. These
data are mapped to attributes in the archetypes, and in the archetype,
"purpose" is used, instead of "name"
It is a fine piece of code, and I use it as a base, but this is a problem.
Besides that, what is the use of a required attribute, when it will be
called differently in the constructor?
Confusing!
I would like to have more clearity on this, because as it is now, this
will lead to stupid code in the rm-builder
thanks
Bert