API Birds of a Feather, XML

Download Report

Transcript API Birds of a Feather, XML

API Birds of a Feather, XML
• Robert C. Leif, Ph.D.
• Vice President R &D, Newport Instruments
& Ada_Med
• Tel. (619)582-0437
• Email [email protected]
• Web: www.newportinstruments.com
How do we work together on APIs?
• Commercial developers should provide sources
and there should be no cost for single and
educational uses.
– ADA DEVELOPERS COOPERATIVE
LICENSE, www.newportinstruments.com
– Software Developers Cooperative,
http://www.softdevelcoop.org/
– http://groups.yahoo.com/group/softdevelcoop/
• GNU licenses include: Other forms of licensing
will be considered.
Which Standard(s)?
Requirements
• Sources and materials available for free
– On the web
• No hidden patents or unreasonable
royalties.
• Operating system independent.
– Must support: Windows, Linux, and Macintosh
• Reasonable design
• Standard’s parsimony
– Create new by reusing old standards.
World Wide Web Consortium (W3C)
http://www.w3.org/
• Only reasonable choice
– XML eXtensible Markup Language
– Schema Data-Types
– SVG Scalable Vector Graphics
– XForms: Forms for the Web
– XSL:fo Formatting language
– SOAP Simple Object Access Protocol
The Browser will be the GUI
• Eliminates duplicate application
programming interfaces for the operating
system and the web.
• Provides portability between operating
systems.
• Open to all.
• Excellent opportunity for Ada!
W3C Compound Document Formats
= Ada program output
• Combine multiple formats:
• XHTML for hypertext
– Extensible HyperText Markup Language
• SVG for graphics
– Scalable Vector Graphics
• SMIL
– Synchronized Multimedia Integration
Language
• XForms for forms on the web
XML Schema
• Ada button: “In Strong Typing We Trust”
• Best argument for schema vs. DTD.
• XML schema can and should have Ada
semantics.
• Need tools for bidirectional translation of datatypes.
• Goal: XML_Io.
• Provides strongly typed output from Ada
programs.
• Facilitates development of applications that
include XML data.
• Permits the use of W3C Designs
– Ada and Web modes
Numbers
•
•
•
•
Create the same numeric types for both.
Ecumenical approach use ECMA types.
http://www.ecma.ch/
Originally, European Computer
Manufacturers Association
• Now, ECMA International - European
association for standardizing information
and communication systems.
Real Types are Primitive
XML
Type
float
double
Source
IEEE singleprecision 32-bit
IEEE double-precision 64bit
ECMA
float32
float64
*decimal W3C
decimal
*Minimum of 18 Digits. Pentium uses
double extended precision floating
point registers. PowerPC uses floating
point registers for fixed-point.
Integer Types are Derived
Type & Derivation
Sequence
ECMA
*integer
MinInclusive
MaxInclusive
-infinity
infinity
nonPositiveInteger
0
negativeInteger
-1
long
Int64
-2**63
(2**63) -1
int
Int32
-2**31
(2**31) -1
short
Int16
SByte
Int8
-2**15
(2**15) -1
-2**7
(2**7)-1
byte
*Derived From decimal; fractionDigits·= 0
XML 32 bit Integer Equivalent
<simpleType name="Int32_Type">
<restriction base="int">
<minInclusive value="-2147483648"/>
<maxInclusive value="2147483647"/>
</restriction>
</simpleType>
Create Unicode Strings by Addition of fields to
Bounded_String
•
•
1.
2.
3.
4.
Encapsulated in generic packages,
Ada.Strings.Bounded. & Wide_Bounded
Solution:
Create a generic that instantiates Ada.Strings.
Wide_Bounded with a generic type.
Add a Character_Set_Type etc. to a private
tagged type.
Add a Modified version of all of the methods in
Ada.Strings.Wide_Bounded
Instantiate (Character_Set => Utf16)
XForms 1.0
W3C Recommendation 14 October 2003
• XForms: model, instance data, and user
interface
• Separates presentation from content
• Benefits: reuse, strong typing, reduction of
round-trips to the server, device independence,
and a reduces the need for scripting.
• XForms
– Not a free-standing document type
– Integrated into XHTML or SVG.
• Examples from http://www.formsplayer.com/
Ada GUI based on SVG & XForms
• Could be based on either CLAW or GNAVI
• Need thick binding for operating system
independence
• Standard Ada implementation based on
SVG data-types produces output to be
executed by operating system
or
• outputs SVG
• XForms can primarily be an SVG
application
SOAP
• Interface SOAP with the Ada Distributed
Systems Annex
And/or
• CORBA replace IDL with XML?
Odds & Ends
• A complete description of Ada in XML
schema would permit the use of an XML
based word processor as a program
editor.
– The design documentation and the
source could be connected by hypertext
links.
• To begin this,I Translated Thomas Wolf’s
AdaBrowse Document Type Definition
(DTD) into a Schema.
Conclusions & Bottom Line
1. Make the Ada and XML schema datatypes the same.
2. Treat the XML presentation tools as a
new very important API for a user
interface standard.
3. Base new Ada API designs on XML
standards.
• Combine SOAP with the Ada Distributed
Systems Annex and/or CORBA