UNIT 6 USING STRUCTURED TEXT IN THE SPECIFICATION OF DATA INTERFACES Flashcards

1
Q

What is an Interchange/Exchange Format?

A

UML class diagrams can be used for the detailed specification of data structures at technical interfaces. However, at technical interfaces, it is particularly vital to ensure that the actual messages exchanged are clearly defined and conceptually accurate in terms of their nature and structure. This is achieved by converting the specified data structure into a particular exchange format. The following requirements must be met when selecting and defining message formats for the storage and transmission of data. The data structure must be maintained, it must be easily readable by humans, and information must be
stored efficiently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the Binary Message exchange format?

A

In a binary message, data are exchanged between systems in the form of a sequence of 0s and 1s. The technical data structure is retained and can be reconstructed directly. The structure and content of binary messages cannot be directly read or written by humans, but data storage is usually very efficient.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the Unstructured Text Message exchange format?

A

Unstructured text messages use typical text characters with no generally prescribed format. The basic structure of the message cannot be defined. When these messages are processed by a system, rules must be agreed upon, but it can be time-consuming to verify compliance. Unstructured text messages are easily read and written by humans, but the technical data structure is lost. There is a risk of syntax errors, i.e., violations of the agreed message structure.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the Structured Text Message exchange format?

A

Structured text messages must be given a clearly defined and readily verifiable structure. The system checks and processes these messages directly based on the specified structure so that quality is readily guaranteed. The technical data structure of the message is converted into a text structure, which, in turn, can be converted into a technical data structure using defined rules. Structured text messages can be read and written by humans with due regard for the defined structure. Possible syntax errors are easily identified because the correct format of each message is automatically checked prior to processing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is XML and how is it structured?

A

It is a widely used, standardized language for storing structured data in text files and exchanging it between systems. XML is a language standardized by the World Wide Web Consortium (W3C) for storing structured data in text files. It facilitates the storage of information using hierarchically structured elements and their attributes. However, the names of the elements and attributes are not taken from a specific vocabulary but can be freely defined using certain rules.
Each XML file has precisely one single root element, which encloses all the other elements. The names of the XML elements are shown between pointed brackets (“<” and “>”) and are known as tags. The content of an XML element appears between the opening tag (for example <id>) and the closing tag (for example </id>). Closing tags are indicated by a forward slash in front of the tag name.
Most element names can be freely selected, provided the following rules are observed: the first character must be a letter, an underscore, or a colon; the remainder may contain
characters or numbers; and the length is essentially unlimited. However, the use of colons should be avoided as they have a different function, and the tag name must not begin with “xml.”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Which types of elements are distinguished within XML?

A

Simple elements, complex elements, and empty elements.
* Simple elements only contain character strings
* Complex elements contain other elements
* Empty elements have no content. The information is the existence of the element and (where applicable) its attributes (An XML element can be specified in greater detail with an unlimited number of different attributes). The HyperText Markup language (HTML) element for line breaks is a typical example.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

How do attributes behave and mean in XML?

A

Attributes are used to assign properties to XML elements. They can only be positioned in the initial tag of the element. The rules for naming attributes are the same as those for tag names. They must also be unique in the element: in other words, they may only occur once in a given element. Attribute values are shown in single or double quotation marks. Attributes are often a useful way of storing information. They are the smallest unit of information in the XML language and therefore cannot be refined any further with additional information. The use of attributes therefore harbors certain risks in terms of flexibility if data structure changes arise mid-way through operation.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

When is an XML file “correct”?

A

There are two levels of “correctness” for an XML file: If it complies with all general syntax rules, it is said to be well-formed. In such cases, for example, all tags must have a corresponding end tag, it must only contain one root element, and all attributes must be shown in inverted commas. Provided the schema rules specified for the XML file are also observed, this is considered a valid (if it is well-formed and complies with all the rules in the specified XML
schema) XML file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a XML Schema and where is it saved?

A

XML offers the option of generating and sending a structured text message. There must be a clearly defined and verifiable design rule for every XML message. Such rules are defined with the XML language XML schema and stored in a file with the extension XML Schema Definition (XSD)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Which elements form the tree structure of the XML file?

A

In terms of its data structure, an XML file represents a tree with precisely one root, and every XML element outside of the root is located in a different element. The leaves of the tree are represented by simple XML elements, which do not contain any further elements. The content of an XML element may therefore be simple (leaf) or complex (child node with further subnodes). Simple elements are of the type simpleType and are used to store simple data types, such as int, float, string, date, and time. Simple types do not contain any further XML elements. Complex elements are specified as complexType. They contain a defined quantity of simple or complex XML elements. To specify complex XML elements in detail, first define a separate element type. All admissible XML elements and attributes are defined in the type definition. Next, define the actual name of the XML element and assign the corresponding element type to that element. In this way, the same element types can be applied to different elements.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How are XML element tyeps defined and what are local/global element types?

A

Element types are defined in a similar way to classes in an object-oriented language. The structure is defined for all instances of that class and is identical in all class objects. If the class is modified, all instances of that class will be modified at the same time. XML elements and XML element types behave in a similar way: If the element type is modified, all XML elements of that type will be modified at the same time.
The XML schema distinguishes between locally and globally defined element types. Local element types are precisely defined in the element corresponding to that type. This type cannot subsequently be reused in other elements. Global element types are declared at the start (or at the end) of the schema file. If an element is structured as a globally declared element type, the type declaration will only specify the reference. These element types are easily and consistently reused multiple times because the structure of all identical elements is described in exactly one place within XML schema.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What attributes are applied to an XML tag to specify frequency?

A

The same elements can recur multiple times in XML files. For example, if an order contains multiple positions, the option of specifying all positions in the XML file must be available.
There are also optional elements that may be omitted depending on the application case in question. The attributes maxOccurs and minOccurs are used in the XML schema to specify frequencies. The quantity given always refers to frequency within a compositor.
* maxOccurs: determines the maximum frequency with which the element may occur in the compositor. The default setting is 1 and will apply until another value is set. The value “unbounded” allows unlimited incidences of an element
* minOccurs: determines the minimum frequency with which the element must occur in the compositor. The default setting is 1 and applies until another value is set. If the value is set at 0, this element is optional.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

How many root elements are there in a XML Schema file?

A

An XML file must have precisely one root element, but several root elements may be declared within an XML schema file. When generating the XML file, precisely one element is selected from available root elements and the XML file is then built according to its structure.
Multiple XML structures within an XML schema may be defined in this way. In practical applications, this allows conceptually related messages which exchange some identical data structures to be combined into a single schema. If complex element types are also globally defined, these definitions will apply to all messages generated on the basis of the schema. In this way, incoming and outgoing messages can be described at a conceptual interface within a file.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Describe briefly how to derive a class diagram from a given XML schema.

A

The specification of technical interfaces often necessitates either the integration of existing technical systems via their interfaces or the conversion of internal conceptual data into technical messages between technical systems. In both instances, either XML messages are converted into business objects or vice versa. Both cases can be supported by modeling XML schemas in class diagrams or, conversely, by modeling class diagrams in XML schemas.
1. All global elements from the XML schema are modeled as classes in the class diagram.
2. All global, complex types from the XML schema are modeled as classes in the class diagram.
3. All simple sub-elements of elements and complex types are modeled as attributes in their assigned classes (i.e., the classes derived from their parent elements or complex types). The actual technical data types of the attributes are incorporated to ensure type protection as the project progresses.
4. All compositors and multiple incidences of elements are expressed by associations. The direction of the association is derived from the elements’ parent/child dependency. The maxOccurs and minOccurs attributes are also taken into account, even if the default values apply, and denoted as multiplicities in the class diagram.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What matters should be taken into consideration when modeling an XML schema in a class diagram?

A

The length and other attribute restrictions may be specified as a constraint, for example { length:8 } or { length:2..n }. Simple types with a restricted value range for global use may
be modeled as an enumeration class. If the sequence of elements in the XML compositor xs:sequence is important, the attributes can be modeled in the class in their correct
sequence if possible. Additionally, the sequence may also be added to the attribute as a constraint, i.e., {order-no=4}.
Modeling the compositor of xs:choice in the class diagram is only possible in certain cases.
If the individual elements within xs:choice lend themselves to generalization under an umbrella term, inheritance may be used in the class diagram. If not, they cannot be directly modeled in UML. In such cases, make a note on the diagram stating that only one element from the set may occur.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What is a web service?

A

A web service is a system function provided via a network, which can be called by other systems. The function is usually called and the response transmitted using structured text, often in the form of XML messages. A description of the functions available as a web service, their parameters, and return values are likewise usually given as structured text.
A web service implements a particular function, for example, the current weather and the weather forecast for a particular location or identification of a book’s International Standard Book Number (ISBN) number. Web services are characterized by stateless processing.
A web service has no internal state; the same parameters will always return the same result. A web service also has a unique uniform resource locator (URL) which is used to call
it.

17
Q

What is the Web Services Description Language (WDSL)?

A

The functions and messages of web services are specified using Web Services Description Language (WSDL). WSDL is an XML language for the specification of web services. The following elements of a web service are defined in a WSDL file:
* functions of the web service with its input and output messages
* service address (URL)
* other technical information regarding access to the service and deployment

18
Q

Define the Structure of a WSDL Specification for Web Services.

A

It begins with the XML file declaration, which is mandatory for all XML files. This is followed by the definitions of parameters and their data types, following the sequence prescribed by the WSDL standard. After the types, the messages are declared. Reference is made to the aforementioned types as the message content. This is followed by a declaration of the functions provided by the Web service. Finally, there is a declaration of technical information about the service, including a pre-
cise specification of the URL where the service can be accessed on the internet. The definition ends with the closing tag of the root element.
The aforementioned elements of the WSDL file for a weather service illustrate the basic structure of such messages. The technical details are too complex to consider in any greater depth here.

19
Q

Describe briefly the Basic Communication Procedure between Systems via Web Services.

A

The client sends an XML message to the web service. First, it validates whether the message is well-formed and valid. Next, it reads the parameters and calculates the result on
this basis. The result is written into an XML message, which is transmitted to the client as a response. The client then checks that the message is well-formed and valid. If the XML message passes both of these tests, the result will be processed.