CS314 Software Engineering RESTful Services Dave Matthews Sprint 1 - - PDF document

cs314 software engineering restful services
SMART_READER_LITE
LIVE PREVIEW

CS314 Software Engineering RESTful Services Dave Matthews Sprint 1 - - PDF document

8/27/18 CS314 Software Engineering RESTful Services Dave Matthews Sprint 1 Architecture 1 8/27/18 JSON - JavaScript Object Notation www.json.org Lightweight data interchange format text format that is language independent


slide-1
SLIDE 1

8/27/18 1

CS314 Software Engineering RESTful Services

Dave Matthews

Sprint 1 Architecture

slide-2
SLIDE 2

8/27/18 2

JSON - JavaScript Object Notation

www.json.org

  • Lightweight data

interchange format

  • text format that is

language independent

  • built on two structures

– name/value pairs (object) – ordered list (array)

JSON - JavaScript Object Notation

JSON to string string to JSON

var var obj

  • bj = {

= { "title":"text title":"text", ", "values":[1,2,3,4,5,6] "values":[1,2,3,4,5,6] }; }; var var str str = = JSON.stringify JSON.stringify(obj

  • bj);

); var var str str = ' = '{ { "title":"text title":"text", ", "values":[1,2,3,4,5,6] "values":[1,2,3,4,5,6] }'; '; var var obj

  • bj =

= JSON.parse JSON.parse(str str); );

slide-3
SLIDE 3

8/27/18 3

Trip Format For Interchange (TFFI)

{ "type type" : "config config", "version version" : 1, "units units" : ["miles"] ["miles"] }

Trip Format For Interchange (TFFI)

{ "type type" : "distance distance", "version version" : 1, "origin

  • rigin" : {"latitude":40.5854,

{"latitude":40.5854, "longitude": "longitude":-105.0844}, 105.0844}, "destination": {"latitude": "destination": {"latitude":-33.8688, 33.8688, "longitude":151.2093}, "longitude":151.2093}, "units":"miles units":"miles", ", "distance":0 "distance":0 }

slide-4
SLIDE 4

8/27/18 4

Web Environment Code Review - /config

  • Client send request

– client/src/components/Application/Application.js – client/src/api/api.js

  • Server RESTful API request handling

– server/src/main/java/com.tripco.t00.server/MicroServer.java

  • Server JSON/Gson request and response conversions

– server/src/main/java/com.tripco.t00.server/Config.java

  • Client response handling

– client/src/components/Application/Application.js