1 / 9

1st ALMA Common Software Workshop

1st ALMA Common Software Workshop. XML « Data by Value » Transport. XML Data by Value Overview. local object. remote object. transportby value. obj.getFoo(). obj.getFoo(). Application. Subsystem1. Subsystem2. fine-grained remote calls degrade performance;

Download Presentation

1st ALMA Common Software Workshop

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. 1st ALMA Common Software Workshop XML « Data by Value » Transport ESO - Garching 08 – 09 March, 2004

  2. XML Data by ValueOverview local object remote object transportby value obj.getFoo() obj.getFoo() Application Subsystem1 Subsystem2 • fine-grained remote calls degrade performance; • more runtime coupling among computers 1st ALMA Common Software Workshop

  3. XML Data by ValueEligible Data • Reasonably small chunks of nested object data, e.g. “User”, “ObservingProject”, “CorrelatorConfig” • Simple parameters as IDL data types, not XML • Bulk data (from correlator, pipelines) transported in binary format, not considered here. • Lists of value objects don’t need to be defined as new value object types; use CORBA sequences of existing value objects instead. 1st ALMA Common Software Workshop

  4. Why XML? • Well-accepted open standard • XML can also be used for persistence (Database or file system) without writing much extra code • XML also for non-CORBA-Transport (email, …) • XML Schema offers constraint declaration and thus enables automatic validation • We can always deal with XML “by hand”. • important for early use of ALMA software when some data producers are not yet available. • test code can easily inject XML data 1st ALMA Common Software Workshop

  5. XML Schema Developers describe their data model in XML schemas <xsd:elementname="SchedBlock"> <xsd:complexType> <xsd:sequence> <xsd:elementname="ObsProcedure"type="xsd:string"/> <xsd:elementname="PhaseCalTarget"type="sbl:PhaseCalTargetT"/> <xsd:elementname="SchedBlockControl"type="sbl:SchedBlockControlT"/> <xsd:elementmaxOccurs="unbounded"name="ObsTarget“ type="sbl:ObsTargetT"/> </xsd:sequence> </xsd:complexType> </xsd:element> truncated example 1st ALMA Common Software Workshop

  6. Binding ClassesConcept • A binding class object represents an XML node in memory; we would thus have a SchedBlock class. • Binding class source code is generated from the XML schemas as part of the software build process • Classes contain code for de-/serialization from and to XML • Type-safe get()/set() methods ensure that data conflicts be noticed at compile time. Huge advantage over generic handling of XML data (as done by DOM or SAX). • Classes contain validation code to enforce schema constraints 1st ALMA Common Software Workshop

  7. Binding ClassesExample packagealma.entity.xmlbinding.schedblock; publicclassSchedBlockextendsalma.entity.xmlbinding.obsproject.ObsUnitTimplementsjava.io.Serializable { // just a few of the generated methods publicvoidaddObsTarget(TargetTvObsTarget) {…} publicjava.util.EnumerationenumerateObsTarget() {…} publicalma.entity.xmlbinding.obsproject.ImagingProcedureTgetSchedBlockImaging() {…} } 1st ALMA Common Software Workshop

  8. Comp Comp container XML XML container Invisible XML Serializationtype-safe data access Flat-XML API seen from outside: XML-string De-/Serialization layer (dynamic) Transparent-XML API implemented by component: SchedBlock binding class, type-safe data access Comp 1st ALMA Common Software Workshop

  9. Invisible XML SerializationStandard and XML-binding-aware Interfaces 1st ALMA Common Software Workshop

More Related