CORBA IDL attributes may be mapped straight forward into standard .NET attributes. (In contrast, the OMG IDL-to-Java mapping maps IDL attributes into instance variables with explicit setter & getter methods.)
CORBA IDL Attributes <---> .NET Attributes
module Attribute { interface Greetings { attribute string Name; readonly attribute string City; string hello(); }; }; |
public class Greetings : GreetingsPOA { private string m_strCity; private string m_strName; public Greetings() { m_strCity = "Hamburg"; } public override string Name { set { m_strName = value; } get { return m_strName; } } public override string City { get { return m_strCity; } } public override string hello() { return "Greetings to " + m_strName; } } |
m_oIGreetings.Name = "John"; |
string strTheCity = m_oIGreetings.City; |
System.Console.WriteLine("'{0}' from '{1}'", m_oIGreetings.hello(), strTheCity); |
a.) Start the Server.
b.) Start the Client.