CORBA Programming Using ACE/TAO - PowerPoint PPT Presentation

Loading...

PPT – CORBA Programming Using ACE/TAO PowerPoint presentation | free to download - id: 56719d-OGE0N



Loading


The Adobe Flash plugin is needed to view this content

Get the plugin now

View by Category
About This Presentation
Title:

CORBA Programming Using ACE/TAO

Description:

CORBA Programming Using ACE/TAO Ken Waller EEL 6897 - Software Development for Real Time Engineering Systems Fall 2007 Agenda What Is CORBA? CORBA Basics Clients ... – PowerPoint PPT presentation

Number of Views:162
Avg rating:3.0/5.0
Slides: 38
Provided by: KenWa96
Learn more at: http://www.eecs.ucf.edu
Category:

less

Write a Comment
User Comments (0)
Transcript and Presenter's Notes

Title: CORBA Programming Using ACE/TAO


1
CORBA Programming Using ACE/TAO
  • Ken Waller
  • EEL 6897 - Software Development for Real Time
    Engineering Systems
  • Fall 2007

2
Agenda
  • What Is CORBA?
  • CORBA Basics
  • Clients, Servers, and Servants
  • ORBs and POAs
  • IDL and the Role of IDL Compilers
  • IORs
  • Tying it all together
  • Overview of ACE/TAO
  • Example 1 Simple Client-Server
  • CORBA Services
  • Naming Service
  • Trading Service
  • Event Service
  • Example 2 Using the Naming Service
  • Multi-Threaded Issues Using CORBA
  • Example 3 A Multi-Threaded Server

3
What Is CORBA?
  • Common Object Request Broker Architecture
  • Common Architecture
  • Object Request Broker ORB
  • Specification from the OMG
  • http//www.omg.org/technology/documents/corba_spec
    _catalog.htm
  • Must be implemented before usable

4
What Is CORBA?
  • More specifically
  • (CORBA) is a standard defined by the Object
    Management Group (OMG) that enables software
    components written in multiple computer languages
    and running on multiple computers to work
    together (1)
  • Allows for Object Interoperability, regardless
    of
  • Operating Systems
  • Programming Language
  • Takes care of Marshalling and Unmarshalling of
    Data
  • A method to perform Distributed Computing

5
What Is CORBA?
CORBA
  • Program A
  • Running on a Windows PC
  • Written in Java
  • Program B
  • Running on a Linux Machine
  • Written in C

6
What is CORBA?
  • CORBA is being used in many industries
  • Defense, Financial, Medical
  • CORBA can be used to
  • Harness the power of several machines to solve a
    problem
  • Several CPUs
  • Simulations
  • Communicate between real Tactical Systems
  • Perform true component based development

7
What is CORBA?
  • Conceptually simple
  • Simply sending messages and data between objects
    running on different machines
  • Not unlike objects communicating
  • Devil is in the Details (3)
  • Many new concepts and terms to learn
  • ORB, POA, IOR, etc.
  • Alphabet Soup
  • True experts are rare and highly sought after
  • Abstraction above Sockets

8
CORBA Basics Clients, Servers, and Servants
  • CORBA Clients
  • An Application (program)
  • Request services from Servant object
  • Invoke a method call
  • Can exist on a different computer from Servant
  • Can also exist on same computer, or even within
    the same program, as the Servant
  • Implemented by Software Developer

9
CORBA Basics Clients, Servers, and Servants
  • CORBA Servers
  • An Application (program)
  • Performs setup needed to get Servants configured
    properly
  • ORBs, POAs
  • Instantiates and starts Servants object(s)
  • Once configuration done and Servant(s) running,
    Clients can begin to send messages
  • Implemented by Software Developer

10
CORBA Basics Clients, Servers, and Servants
  • Servants
  • Objects
  • Implement interfaces
  • Respond to Client requests
  • Exists within the same program as the Server that
    created and started it
  • Implemented by Software Developer

11
ORBs and POAs
  • ORB Object Request Broker
  • The ORB in CORBA
  • At the heart of CORBA
  • Enables communication
  • Implemented by ORB Vendor
  • An organization that implements the CORBA
    Specification (a company, a University, etc.)
  • Can be viewed as an API/Framework
  • Set of classes and method
  • Used by Clients and Servers to properly setup
    communication
  • Client and Server ORBs communicate over a
    network
  • Glue between Client and Server applications

12
ORBs and POAs
  • POA Portable Object Adapter
  • A central CORBA goal Programs using different
    ORBs (provided by different ORB Vendors) can
    still communicate
  • In the early days of CORBA, this was not possible
  • A clear shortcoming
  • The POA was adopted as the solution
  • Can be viewed as an API/Framework
  • Set of classes and method
  • Sits between ORBs and Servants
  • Glue between Servants and ORBs
  • Job is to
  • Receive messages from ORBs
  • Activate the appropriate Servant
  • Deliver the message to the Servant

13
CORBA Basics IDL
  • IDL The Interface Definition Language
  • Keyword Definition
  • No executable code (cannot implement anything)
  • Very similar to C Header Files
  • Language independent from Target Language
  • Allows Client and Server applications to be
    written in different (several) languages
  • A contract between Clients and Servers
  • Both MUST have the exact same IDL
  • Specifies messages and data that can be sent by
    Clients and received by Servants
  • Written by Software Developer

14
CORBA Basics IDL
  • Used to define interfaces (i.e. Servants)
  • Classes and methods that provide services
  • IDL Provides
  • Primitive Data Types (int, float, boolean, char,
    string)
  • Ability to compose primitives into more complex
    data structures
  • Enumerations, Unions, Arrays, etc.
  • Object-Oriented Inheritance

15
CORBA Basics IDL
  • IDL Compilers
  • Converts IDL files to target language files
  • Done via Language Mappings
  • Useful to understand your Language Mapping scheme
  • Target language files contain all the
    implementation code that facilitates CORBA-based
    communication
  • More or less hides the details from you
  • Creates client stubs and Server skeletons
  • Provided by ORB Vendor

16
CORBA Basics IDL
IDL Compiler
IDL File
Generates
Generates
Client Stub Files
Server Skeleton Files
Client Program
Servant Object
Inheritance
Association
Client Programs used the classes in the Client
Stub files to send messages to the Servant objects
Servant Objects inherit from classes in the
Server Skeleton files to receive messages from
the Client programs
  • Generated Files are in Target Language
  • C
  • Java
  • etc.
  • Generated Files are in Target Language
  • C
  • Java
  • etc.

17
CORBA Basics IDL
  • Can also generate empty Servant class files

IDL Compiler converts to C (in this case)
18
CORBA Basics IORs
  • IOR Interoperable Object Reference
  • Can be thought of as a Distributed Pointer
  • Unique to each Servant
  • Used by ORBs and POAs to locate Servants
  • For Clients, used to find Servants across
    networks
  • For Servers, used to find proper Servant running
    within the application
  • Opaque to Client and Server applications
  • Only meaningful to ORBs and POAs
  • Contains information about IP Address, Port
    Numbers, networking protocols used, etc.
  • The difficult part is obtaining them
  • This is the purpose/reasoning behind developing
    and using CORBA Services

19
CORBA Basics IORs
  • Can be viewed in stringified format, but
  • Still not very meaningful

20
CORBA Basics IORs
  • Standardized, to some degree


  • Standardized by the OMG
  • Used by Client side ORBs to locate Server side
    (destination) ORBs
  • Contains information needed to make physical
    connection
  • NOT Standardized by the OMG proprietary to ORB
    Vendors
  • Used by Server side ORBs and POAs to locate
    destination Servants

21
CORBA Basics Tying it All Together
  • In order to use CORBA
  • Obtain a CORBA implementation
  • ACE/TAO is used in this presentation (free, open
    source)
  • ORBIX (commercial) is most widely used (better
    support)
  • Consider what platforms and languages vendor
    supports
  • Learn how to use the CORBA API
  • Can read the specification
  • Massive
  • Perhaps too technical
  • Recommended Find a good CORBA book
  • More clear and concise
  • See (3)
  • Must also rely on documentation from the CORBA
    implementation provider
  • The specs standardize lots of things, but not
    everything
  • Some aspects left to the CORBA implementers

22
CORBA Basics Tying it All Together
  • Recommended development strategy
  • Develop IDL and system architecture (i.e.
    High-Level design)
  • Sequence Diagrams and UML can be useful during
    this phase
  • Decide IOR passing strategy (i.e. CORBA Services)
  • Design and Develop Server and Client programs

23
CORBA Basics Tying it All Together
  • In general, a Server program must take the
    following steps
  • Configure the ORB
  • Configure the POA
  • Create and Configure the Servant object
  • Register the Servants IOR with a CORBA Service
  • Start the Servant
  • In general, a Client program must take the
    following steps
  • Configure the ORB (different from Server ORB)
  • Obtain a Servants IOR from a CORBA Service
  • Use the IOR to call a method on the Servant
    object
  • These directions are oversimplification
  • Must learn how to use the CORBA API properly
  • This is just a High-Level view
  • In general, the server program must be run before
    the client program

24
CORBA Basics Tying it All Together
25
CORBA Basics Tying it All Together
Logical Flow
Client Program
Server Program
Servant
Message(Data)
IOR (Servant Ref)
Actual Flow
Client Program
Server Program
  • Once ORBs and POAs set up and configured
    properly, transparency is possible
  • ORBs communicate over network
  • POAs activate servants and deliver messages

Servant
IOR (Servant Ref)
POA
ORB
ORB
26
Overview of ACE/TAO
  • ACE Adaptive Communications Environment
  • Object-Oriented Framework/API
  • Implements many concurrent programming design
    patterns
  • Can be used to build more complex
    communications-based packages
  • For example, an ORB
  • Freely available from (2)

27
Overview of ACE/TAO
  • TAO The ACE ORB
  • Built on top of ACE
  • A CORBA implementation
  • Includes many (if not all) CORBA features
    specified by the OMG
  • Not just an ORB
  • Provides POAs, CORBA Services, etc.
  • Object-Oriented Framework/API
  • Freely available from (2)

28
Example 1 Simply Client/Server
29
CORBA Services
  • Previous example
  • Server started the Servant
  • Servant wrote its IOR out to a file in a
    stringified format
  • Client obtained IOR by reading the IOR in from
    the file
  • This is not true distribution
  • The CORBA Specification includes extensions to
    help facilitate obtaining IORs in a more
    distributed fashion

30
CORBA Services The Naming Service
  • The CORBA Naming Service is similar to the White
    Pages (phone book)
  • Servants place their names, along with their
    IORs, into the Naming Service
  • The Naming Service stores these as pairs
  • Later, Clients obtain IORs from the Naming
    Service by passing the name of the Servant object
    to it
  • The Naming Service returns the IOR
  • Clients may then use to make requests

31
CORBA Services The Trading Service
  • The CORBA Naming Service is similar to the Yellow
    Pages (phone book)
  • Servants place a description of the services they
    can provide (i.e. their Trades), along with
    their IORs, into the Trading Services
  • The Trading Service stores these
  • Clients obtain IORs from the Trading Service by
    passing the type(s) of Services they require
  • The Trading Service returns an IOR
  • Clients may then use to make requests

32
Example 2 Using the Naming Service
33
Multi-Threaded Issues Using CORBA
  • Server performance can be improved by using
    multiple threads
  • GUI Thread
  • Listening Thread
  • Processing Thread
  • Can also use multiple ORBs and POAs to improve
    performance
  • Requires a multi-threaded solution

34
Example 3 A Multi-Threaded Server
35
Conclusions
  • Advantages
  • Object-Oriented distributed communication
  • Easy to define messages and data contents using
    IDL
  • Once setup/configuration of ORBs, POAs,
    Servants, IORs complete, communication is fairly
    straightforward
  • Relieves programmers from having to write Socket
    software
  • Disadvantages
  • Can be difficult to learn
  • Even harder to master
  • Scalability issues could cause a mind-boggling
    amount of ORBs, POA, threads, etc. to be used
  • Acquiring IORs can be difficult

36
References
  • (1) http//en.wikipedia.org/wiki/CORBA
  • (2) http//download.dre.vanderbilt.edu/
  • (3) Advanced CORBA Programming with C by
    Henning and Vinoski

37
Questions?
About PowerShow.com