2009-04-26

Weekly Report for Project(2009-04-26)

Hi,  Ben
        I have described my current progress about project,  and question list which i have now in this report,  can you spend a little time to review it and give me a feedback,  thank you:-)

1.  Things which I have done in this week
        (1)   Read all the relative documents in wiki,   such as User Guide,  Administrator Guide,  and Developer Guide,  etc
        (2)   Read the Tutorial of Simple Framework And know about the basic API of Simple,  mainly about   @Element,  @Atribute,  @ ElementList,  etc
        (3)   See a part codes of current domain objects

2.  Things which I am doing now
        (1)   Continue reading codes of current domain objects in Openmrs.
        I want to know more information of Simple’s annotations in Openmrs by do this.

3.  Question List
        (1)   The determinate range of objects which need be serialize/deserialize by XStream?
        When I see the code in domain objects,  I find that a few classes under the package “org.openmrs” are not have the any config annotation of Simple Framework,  such as Drug.java,  Order.java,  etc.
        Besides,  several classes not in package “org.openmrs”,  such as the “Parameter.java” in the package “org.openmrs.report”,  these classes also have the annotations of Simple Framework.
        So I am puzzled with the determinate range of objects which need to serialize.   Apparently,  the range of all domain objects in package “org.openmrs” is not same with the range of classes which have annotations of Simple Framwork.

        (2)   As using XStream to serialize objects,   now I have find three places which maybe need XStream to implement and haven’t be implemented in current code of Openmrs.
        1st:   “Root(strict=false)”
        In XStream,  it just implements the feature of “Root(strict=true)”.

        2nd:   “Element(required=true)”/”Attribute(required=true)”
        In XStream,  it only implements the feature of “(required=false)”,  it doesn’t have choices to config for “(required=true)”

        3rd:   “Element(data=true)”
        In XStream,  it doesn’t have this feature as Simple.  It just put the entity label for those special letter.

        All above,  I want to know while using XStream to serialize objects,  whether need these features all the same?   Or just a part?

        Ben,   As you say,   I have look a few topics,  if want to implement feature about “Element(data=true)”,  then need to upgrade XStream,  we need to override the HierarchicalStreamWriter class.   But I am not very sure if this manner can be suitable,  because I haven’t writen any trial code.

        (3)   Which properties of Class need to be omitted and which properties of Class need to exist in XML file as the Attribute?   (just as which properties need “useAttributeFor” and “omitField” method)
        I think whether I can get the exactly information just from the current information of Simple Framework’s annotations which have been defined in OpenMRS project.

        (4)   Which classes need Converter ?
        Now as my current knowledge,  I think just those classes (which don't serialize most of their properties or have some special converting mechanism while serialize their properties) need the Converter.

        (5)   The determinate requirements for serializing objects in my project?
        Now as i see more domain objects of Openmrs,  I find a few difference between serializing using XStream and Simple in Openmrs.  Such as some properties are defined as Attribute in the serialized xml string by Simple while they are defined as Element in the serialized xml string.  I think here is a few unmatched places and we need to fix them.


        (6)   At last i want to comfirm whether email or blog is the more convenient manner to communicate between us(such as reporting my current progress and submit my current question list,  etc)  ,   Ben ? And if you think i should using blog to submit my question list,  do you consider i should put post with label "openmrs",  because i think the talk about my question is just between us is ok?   do you agree?

        For me the two manners(email and blog) is ok,  you think which is more convenient i will do which:-)

1 comment:

  1. 1) The only objects that have Simple annotations are the ones that we needed to serialize. We have yet to have a reason to serialize all objects. Objects related to Concepts were given Simple tags because of my work with the OCC. That work hasn't gotten off the ground yet, so that shouldn't be a problem. The org.openmrs.report objects have Simple annotations because of the serializing with do to the ReportSchema object. See ReportSchemaXml and its related pages, storage, etc.

    2) In Simple, Root(strict=false) just means that at least one element is optional and doesn't have to be in the xml when being deserialized. If xstream supports "(required=false)" on each attribute, that should be ok. It would be nice if there was a way to say that "name" is a required element when deserializing somewhow. I think we will need CDATA in elements because there are some descriptions, etc that will be serialized that have special xml characters in them. If the [[CDATA ... ]] thing is not used, then xml readers will complain. Does xstream just do CDATA by default maybe?

    3) Yes, just take from Simple for now. Ignore the current xstream stuff we have.

    4) There are a lot of objects that will need similar converters. Anything that extends BaseOpenmrsMetadata object, for instance, has a name, description, creator, dateCreated. Those are pretty straightforward. The objects that will need special treatment are the ones that have child Lists on them (Person.getPersonNames, Concept.getConceptAnswers, etc)

    5) If our Xstream and Simple ones disagree right now, go with Simple. :-)

    6) Blog is ok for questions. Tag it with openmrs for two reasons:

    A) It is a good example for other students to also blog.

    B) If another developer wants to chime in with their ideas, they can. In this way, don't address it to me so that others feel like they can comment. I REALLY like that you made the questions red. Keep that up! :-)

    ReplyDelete