Overview of Value Semantics

A value type combines the characteristics of an IDL struct and an IDL interface. A regular value can declare state members (displaying struct-like character) and operations and attributes (displaying interface-like character). For example, an AccountVal type could be declared as a regular value, as shown in Listing 11.1.

Listing 11.1. An AccountVal Type Declared as a Regular Value
valuetype AccountVal {
    // state members
    public  long   m_account_id;
    public  string m_owner;
    private long   m_balance;

    // operations
    boolean withdraw(in long amount);
    void    pay_in(in long amount);

The AccountVal value type could represent a cached database record in a server. The state members of AccountVal—that is, m_account_id, m_owner ...

Get Pure CORBA now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.