container-component model and xml in alma acs heiko sommer (eso), gianluca chiozzi (eso), klemen...

19
Container- component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

Upload: stuart-haynes

Post on 27-Dec-2015

220 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

Container-component model and XML in

ALMA ACS

Heiko Sommer (ESO), Gianluca Chiozzi (ESO),

Klemen Zagar (Cosylab) and Markus Völter

Page 2: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

2SPIE 22 June 2004 Container-component model and XML in ALMA ACS

CORBA ORBs, Stubs, Skeletons

namingservice

OverviewCORBA…

appl

i-ca

tion

appl

i-ca

tion

appl

i-ca

tion

appl

i-ca

tion

config config

log-service

Page 3: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

3SPIE 22 June 2004 Container-component model and XML in ALMA ACS

CORBA ORB

Manager, CDB

Overview…tamed by ACS…

container

com

p

com

p

container

com

p

com

p

Page 4: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

4SPIE 22 June 2004 Container-component model and XML in ALMA ACS

CORBA ORB

Manager, CDB

OverviewXML exchange like in web services…

container

com

p

XMLco

mp

container

com

p

com

p

Page 5: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

5SPIE 22 June 2004 Container-component model and XML in ALMA ACS

CORBA ORB

Manager, CDB

Overview… but with type-safe data access

container

com

p

XMLco

mp

container

com

p

com

p

Page 6: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

6SPIE 22 June 2004 Container-component model and XML in ALMA ACS

Container / CORBA

container

com

p

com

p

functional component interface generated from CORBA IDL:

Operations with IDL data types as parameters.

componentPOA (tie)

comp impl

containermain()

ORB

sealant

dynamicimpl lifecycle IF

CORBA IIOP

container POA

Page 7: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

7SPIE 22 June 2004 Container-component model and XML in ALMA ACS

What’s missing in CORBA?

• CORBA architecture favors relatively tight coupling– data embedded in remotely accessible objects

– only fine-grained data transported by value

• CORBA IDL has only limited support for by-value transport of hierarchical data (nested structs, valuetypes)

• Serialization format is not suitable for persistence

Page 8: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

8SPIE 22 June 2004 Container-component model and XML in ALMA ACS

How about Web Services?

Web Services aim at looser coupling of system components than CORBA

Hierarchical data can be sent in message parameters, coded as XML

XML (WSDL) for data type and interface definitionXML representation of data reusable for persistence

Page 9: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

9SPIE 22 June 2004 Container-component model and XML in ALMA ACS

Web Services go too far…

† Loss of static type checking † Made for business-to-business communication

(“middleware for middlewares”), not within one project that can afford complete builds

† client side coding is proprietary to the WS framework† text-based protocol is too inefficient for many kinds

of data exchange in our domain

Page 10: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

10SPIE 22 June 2004 Container-component model and XML in ALMA ACS

XML strings over CORBA“The Middle Way”

• keep CORBA as the underlying middleware• use XML data as string arguments of CORBA

IDL-defined operations• data definition in XML schema• coexistence with CORBA binary types

com

p

com

p

XMLoperation1(in string SchedBlock sb)

operation2(out float[] largeBinaryData)

No type safety yet!

XML schema

IDL

def

def

Page 11: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

11SPIE 22 June 2004 Container-component model and XML in ALMA ACS

Textual XML not type-safe!

<ourFood> <apple grade=“A”/> </ourFood>

com

p

com

p

<myFood> <pear size=“5”/> </myFood>

Page 12: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

12SPIE 22 June 2004 Container-component model and XML in ALMA ACS

Type-safe XML Representation

† generic representation of XML data (string, DOM) always prohibits static type checking

restore type-safety by using generated classes that match the particular XML data (as defined in the XML schema) : XML Binding Classes

Page 13: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

13SPIE 22 June 2004 Container-component model and XML in ALMA ACS

XML Binding Classes Type-safe XML Representation

Binding ClassGenerator(Castor)

XML schema<xsd:element name=“SchedBlock”>+ Nested Child elements

(Java) Binding Classes

buildtime

runtime

1..n

0..1

XML XMLserializeparse

string typed Java objects

string

Page 14: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

14SPIE 22 June 2004 Container-component model and XML in ALMA ACS

Page 15: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

15SPIE 22 June 2004 Container-component model and XML in ALMA ACS

Type-safe XML exchangeConceptual View

transparent-XML interface:

XML data appears as a tree of native-language binding

classes

mapper instantiates binding classes from XML strings and back

between collocated components, binding objects

can be sent directly

container

com

p

com

p

XML

mapper mapper

flat-XML interface seen from outside

XML data transported as a

string over CORBA

container

com

p

mapper

Page 16: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

16SPIE 22 June 2004 Container-component model and XML in ALMA ACS

<xsd:element name=“SchedBlock”> <xsd:element name="schedBlockImaging“ type="prj:ImagingProcedureT“ maxOccurs="unbounded" />

</xsd:element>

buildtime

runtime

Complex data type defined as XML schema

typedef XmlString SchedBlock;

interface MyComp { void myOperation(

SchedBlock sb) }

Operation defined in IDL

ref

1..n 0..1

interface MyComp { void myOperation( bind.SchedBlock sb) }

Generated Java Interface

Server componentco

mp

implementsSchedBlockBinding Class Instances

Client component co

mp

Page 17: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

17SPIE 22 June 2004 Container-component model and XML in ALMA ACS

Build Process

ACS IDLcompiler

Makefile mapping info:“SchedBlock ->

alma.bind.SchedBlock”

alma.data.ObsProjectgetObsProject

CORBA IDL compilertypedefxmlstring

ObsProject; …

ObsProjectgetObsProject()

IDL IF XmlEntityStructgetObsProject

together in one JAR file

ACS IDLcompiler

Makefile mapping info:

alma.bind.SchedBlockgetThatSB()

CORBA IDL compilertypedef XmlString

SchedBlock; …

SchedBlockgetThatSB()

IDL IF

flat-XML “MyInterface”

XmlStringgetThatSB()

together in one JAR file

transparent-XML “MyInterfaceJ”

Page 18: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

18SPIE 22 June 2004 Container-component model and XML in ALMA ACS

Design View showing CORBA

flat-XML functional IF

(CORBA)

skeleton (tie)(CORBA)

stub(CORBA)

skeleton impl(ACS, dynamic XML mapper)

impl

transparent-XML IF

(ACS)

server component

delegatesimpl

client proxy(ACS, dynamic XML mapper)

delegates

client component

calls

CORBA remoting

impl.

impl

delegates

server containerclient container

implXML

Page 19: Container-component model and XML in ALMA ACS Heiko Sommer (ESO), Gianluca Chiozzi (ESO), Klemen Zagar (Cosylab) and Markus Völter

19SPIE 22 June 2004 Container-component model and XML in ALMA ACS

Summary

• Enable components (different languages) to exchange hierarchical data in a type-safe manner

• Container/component model hides the gory details from the components

• Fully CORBA compliant (not just for ACS components as clients)