Report bugs | Sign in
Powered by Melange
Release 0-6-20091207

Student Name: Zhuangwei Lu
Mentor Name: Ben Wolfe
Co-Mentors: daniel kayiwa
Title: Add Serialization Service
Abstract: In this project,I will implement a new serialization that using XStream to do the function of serialize/deserialize all the domain objects.
In the previous code of OpenMRS,it serialize/deserialize the domain objects by Simple Framework.Now throuth my implemenation,we don't need put annotations in each domain object.We can put all config information in a seperate XML file.Just define a method to read config information and use the API of XStream will instead of the Simple Framework.
Public info:

Steps for Project

(1)     I will determinate a list of classes which need to be serialized

According to my research for previous Simple Framework in Openmrs Project, I will give a list of classes need to serialize, as follow:

 

* relative domain objects:

     Cohort

     Concept

     ConceptName

     ConceptNameTag

     ConceptDescription

     ConceptAnswer

     ConceptSet

     ConceptMap

     ConceptClass

     ConceptDatatype

     ConceptComplex

     ConceptDerived

     ConceptNumeric

     ImplementationId

     Patient

     Person

     PersonName

     PersonAddress

     PersonAttribute

     PersonAttributeType

     Program    

     User

* other objects need to be serialized:

     CohortDataSetDefinition

     Parameter

     ReportData

     ReportSchema

     RowPerProgramEnrollmentDataSetDefinition

     RowPerObsDataSetDefinition

     StaticCohortDefinition

     PatientSearch

     SearchArgument

 

(2)     Do for every class in step (1) and here I will divide to three small steps

* Using XStream’s API to config for this class

Here are two instances:

  First:

        If most parts of this class need to be serialized, I will only use method “useAttributeFor” and “omitFiled” to config for this class

  Second:

        If we don’t want most parts of this class to be serialized, I will write a Converter class for this class

        

* Write the unit test for this class

  While writing unit test, there will be two requirements, as follow:

  #1: Serialize the object and compare that to a given string

  #2: Deserialize a string to an object and check that everything was put into the object

 

* Remove the Simple Annotations in this class

  After I have tested for this class, I will remove all Simple Annotation in this class.

 

(3)     Write relative documents about this project

    After step(1) and step(2), I will complete the taget 1, 2 and 3 in “http://openmrs.org/wiki/Unassigned_Projects#Serialization_Service”.

So the left task for me is to write the relative documents about this project, and in this document, I think I will contain information about which classes need to serialize, while serializing, which properties need to be as a attribute and which properties don’t to be serialized.

(4)     Do the extra credit for OCC project

I think I will try my best to achieve this task after I have completed the previous three main steps. But, now I haven’t determinate steps to complete this task. I have just read some documents about this project and working group in Openmrs wiki. I think after I have completed the Serialization Service project, it will be easy for me to do this task.

 

Hard Points and Solutions

(1)     Which properties need to be as a attribute in XML

Resolve: just refer to the Simple Annotation “@Attribute” in class

(2)     Which properties don’t need to be serialized

Resolve: just those properties which don’t have Simple Annotation in their get/set method

(3)     When need a Converter for a class

Resolve: just there are only a small part of this class need to be serialized to XML

   Note: I think in the course of working for my project, I will find more new hard points, but I will overcome these hard, at last complete my project.

 

Timeline

My timeline will be from now (May.10) to Aug.17 and the number described in follow means the sequence number of week during this time.

 

1 – 2 week: I will finish about 5 classes described in step(1) of “Steps for Project”, this work contains using XStream’s API to config for serialize, write unit test for these five classes and remove Simple Annotations.

 

3 – 8 week: During this time, every week I will finish about 5 classes and the work’s form as “1 – 2 week”.

    Note: After the previous 8 weeks, the target 1, 2 and 3 which are described in project’s wiki (“http://openmrs.org/wiki/Unassigned_Projects#Serialization_Service”). will be completed.

 

9 – 10 week: Write documents about this project which is described as target 4 in project’s wiki(“http://openmrs.org/wiki/Unassigned_Projects#Serialization_Service”) . And also improve relative codes and tests.

 

11 – 13 week: Work for Occ project. I think maybe the time is a little tight. But I think firstly I will try my best to add my speed for “Serialization Service” project and if possible I am pleased to continue working for Occ project after the GSoC 2009. I like our organization and peoples.