Get Cheapest Assignment in Australia, UK, US, UAE, Canada and NZ Order Now

Service-oriented Architectures university of Leicester

0 Comments

Get this assignment for just 90 Pounds

Email: Punjabassignmenthelp@gmail.com

Call or whats app: +447464884564

University of LeicesterSOA: Service-oriented
Architectures
Winter 2020
Reiko Heckel (reiko@mcs.le.ac.uk)

Coursework 2: From UML to XML and JSON

This model describes the data held by a Weather Service that provides the backend of a mobile Weather App. Among other functions, it finds and forwards relevant weather alerts to notify app users of any dangerous conditions in their local area. The data model below, for the Weather Service includes Alerts linked to Forecasts and Locations, app Users and their Location.

The Weather Service gets its data from a data service. We consider two variants: A Local Data Service providing localised alerts and a Global Data Service providing all current alerts regardless of location.

The operation signatures are

getAlerts(loc: Location): List <Alert>

Returns the list of all alerts relevant to location loc, with their forecasts

getAllAlerts(): List <Alert>   

Returns a list of all available alerts with their locations and forecasts

We assume that the list of alerts for any given location is small, so file size is not a problem. The list of current alerts regardless of location may be large, so we need to minimise file size, avoiding redundancy where possible.

Assignment  

The problems in Part A and B are independent of each other. While they use some of the same class models and requirements, they are concerned with different operations, scenarios and target languages. Therefore, your design choices to A and B can be different, too. 

Part A: JSON – based on Part 3 of the Lecture

Create a sample JSON object that could be returned as a result of invoking

getAlerts({“ycoord”: “52.6211”, “xcoord”: “1.1246”})

as specified above, in the following steps.

  1. Create a reduced class diagram containing only the elements relevant to this task. Justify your choices.

[10 marks]

  • Create a class diagram defining the structure you want to use to represent the data in JSON. This is analogous to an XML-specific class diagram, except that the target language is JSON.  What is the structure of the mapping you have to use?

[10 marks]

  • Derive a JSON Schema, aiming to capture the same data and constraints as your JSON-specific class diagram in 2.

[15 marks]

  • Create the sample JSON object following your JSON schema. Use the JSON validator at https://www.jsonschemavalidator.net to check your JSON object against your schema and include a screenshot of the valid documents in the web forms as proof.

[10 marks]

Part B: XML – based on Part 2 of the Lecture               

Design a DTD that could support the data returned by an invocation of getAllAlerts() as specified above, following the steps below. Take care to create a solution that minimises redundancy to ensure a compact representation of the data.

  • Create a reduced class diagram containing only the elements relevant to this task. Justify your choices.                                                                                                                         [10 marks]
  • Create an XML-specific class diagram and justify the chosen document structure using the requirements from the scenario. Justify your choices.                                                                                                                                                                                                      [10 marks]
  • Derive the DTD and justify the style of mapping you have chosen for the attributes.

[15 marks]

  • Is the mapping from the class diagram in 6. to the DTD data-preserving? Please justify your answer. In particular
    • If the mapping does not extend the data capacity, provide a valid object diagram as counterexample and explain why there is no corresponding valid XML instance.
    • If the mapping does not reflect data capacity, provide a valid XML instance as counterexample and explain why there is no corresponding valid object diagram. 

[20 marks]

Leave a Reply

Your email address will not be published. Required fields are marked *