Relocatable hierarchical software design
Wednesday, November 2, 2016
Upload XML data to MySQL or NoSQL
Upload XML data to MySQL or Google Datastore
class reference diagram
HttpServlet
UploadFile servlet
RestoreXML - Google Datastore
RestoreXML - MySQL
parameter
SAXParser
UploadFileString
//read servlet input
DefaultHandler
RestoreXmlHandler
CreateRestoreTypes
GoogleSaveRestoreTypes
SqlSaveRestoreTypes
RestoreXml environment
data cache
db connection
draw diagrams logically from specification
Use the specification to generate/inject objects
UploadFileString:
getUploadedFile
new RestoreXmlHandler
data store: getLists
SaveRestoreTypes:
save
data store: add
CreateRestoreTypes:
createType
saxParser.parse(handler)
RestoreXML:execute
UploadFile:processRequest
control flow
append buf value to
current refvar value
characters
current typename
= element name
yes
no
current typename is null
current refvar
= element name
no
yes
root element is null
root element
= element
startElement
//input record format
<Typename>
<Refvar>refvalue</Refvar>
....
</Typename>
build current typename record
clear refvar value map
set current typename null
yes
no
element name is
current typename
error
no
yes
element is root element
save the data
endElement
saxParser handler api
No comments:
Post a Comment
Older Post
Home
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment