ASN.1
Previous: Purpose of ASN.1 Up: ASN.1 Next: Abstract Syntax Notation


Example

  The inventory example in a later Chapter presents an appropriate environment to illustrate the situation. Suppose data on specific items in Store A are sent to Store B, which uses a different system and, possibly, a different programming language. Each system might be flexible and large enough to handle the communication by translating each representation of the data into the representation in the other system. However, this approach would become untenable as the number of stores with different systems increased or as systems changed at individual stores over time. A better solution is to make communication independent of change. This can be achieved by using a defined set of rules, an abstract syntax, for representing the data types and structures of the items stored in the inventory database, and another set of rules for transmitting the data, a transfer syntax. These sets of rules would be common for all systems. Each system would then require the capability to translate the abstract representation into a realization for the system.

More specifically, assume the item can be represented by the four-tuple [PN, Q, WP, SP], for part number (a string), quantity (an integer), wholesale price (a real), and sale price (a real), respectively, and that an abstract syntax has been defined for these variables and their data types. A Pascal program in Store A's system and a C language program in Store B's system include references to the item. Before the program is run, a compiler in Store A's system translates the abstract representation into a concrete syntax consisting of a Pascal structure (as if it were part or all of the declaration section) and a set of encoding/decoding procedures. A corresponding Application process is established in Store B's system using C instead of Pascal. When the data are sent from Store A, the encoding procedure is called and produces an encoded version to send to Store B's system (using appropriate aspects of each of the lower layers in the OSI model). There, the decoding procedure is called and the C structure is stored. Although programmers in Stores A and B could develop their own syntax and encoding rules, they would be better off using the ASN.1 abstract syntax and BER transfer syntax established as international standards.


Previous: Purpose of ASN.1 Up: ASN.1 Next: Abstract Syntax Notation


This site was developed from:
Computer Networks and Open Systems
An Application Development Perspective

by
Lillian N. Cassel
Richard H. Austing

Jones & Bartlett Publisher
ISBN 0-7637-1122-5

This site is hosted by:


Real World ASN.1 and XML Solutions