SOA Coursework 2: XML, JSON, and Object Diagram Analysis, Winter 2019

Verified

Added on  2023/04/23

|5
|511
|253
Practical Assignment
AI Summary
This assignment addresses the conversion and analysis of an e-voting system's public data model, focusing on mapping from UML to XML and JSON formats. The solution starts with an object code representation and JSON validation, comparing the generated class diagrams to the given model, and examining data capacity extension, reflection, and redundancy. It then moves to XML, creating an XML document, an XML-specific class diagram, and a DTD, justifying the chosen document structure based on the scenario's requirements. The assignment also assesses the mapping's ability to represent data capacity and provides an XML snippet. Finally, it concludes by creating a valid object diagram depicting a cyclic delegation between two Voters, referencing relevant literature on JSON and XML schema. The coursework focuses on the practical application of these technologies in the context of a service-oriented architecture.
Document Page
1.Object code;
{"motion":{
"title1":"motion1",
"title2":"motion2",
"votingRecord":{
"motion1":"yes",
"motion2":"Delegated"
}
}
}
2.json validation
a. What are the differences between the given and the generated class diagrams?
How are these differences justified?
The generated class has two object. This is because I considered the motions and and their
voting records.
b. What is the structure of the mapping used?
c. Is data capacity extended, reflected, preserved?
Reflected. It takes variables, conditions, and contextual information into account.
d. Does the mapping create redundancy? If yes, is there a way to avoid it and
can you demonstrate a redundancy free mapping using the example JSON object
from 1?
No. it captured the requirements instructions.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
Part B: Xml
3.
Xml document:
<?xml version="1.0" encoding="UTF-8"?>
<motion>
<title1>motion1</title1>
<title2>motion2</title2>
</motion>
<votingRecord>
<motion1>yes</motion1>
<motion2>delegated</motion2>
</votingRecord>
Justification
Motion. There were two motion to be voted for in the scenario.
votingRecord. Stores data for the action on the two motions.
Delegated. Shows a motion that was delegated by voters.
4. Create an XML-specific class diagram and justify the chosen document structure using
the requirements from the scenario.
Document Page
Justification
All the classes description in the scenario are captured.
5. The DTD:
<!ELEMENT vote (motion)*>
<!ELEMENT motion(title1,title2)>
<!ELEMENT title1(#PCDATA)>
<!ELEMENT title2(#PCDATA)>
<!ELEMENT votingRecord(motion1,motion2)>
<!ELEMENT motion1(#PCDATA)>
<!ELEMENT motion2(#PCDATA)>
a).
Document Page
There is no corresponding XML instance as the object mapping doesn’t represent actual actual
data preserving.
b). XML snippet:
<vote>
<motion>
<title1>motion1</title1>
<title2>motion2</title2>
</motion>
<votingRecord>
<motion1>yes</motion1>
<motion2>delegated</motion2>
</votingRecord>
</vote>
The XML file above cannot be sufficiently mapped to an object diagram to represent data
capacity.
6. Create a valid object diagram with a cyclic delegation between two Voters.
tabler-icon-diamond-filled.svg

Paraphrase This Document

Need a fresh take? Get an instant paraphrase of this document with our AI Paraphraser
Document Page
References.
1. Json Book: Easy Learning of Javascript Standard Object Notation by Steven Keller.
2. XML Schema: The W3C's Object-Oriented Descriptions for XML by Eric van der Vlist.
chevron_up_icon
1 out of 5
circle_padding
hide_on_mobile
zoom_out_icon
[object Object]