COBRA (Common Object Requesting Broker Architecture)
COBRA (Common Object Requesting Broker Architecture) is a standard developed by the Object Management Group (OMG) for the interoperability of distributed objects. COBRA is a middleware that allows applications written in different programming languages and running on different operating systems to communicate and interact with each other.
COBRA is based on the client/server model, in which clients request services from servers. In COBRA, a client sends a request to a server for a service, which may be provided by another server. The request and the response are both transmitted in a standard format called the Common Data Representation (CDR).
COBRA defines three main components:
- Object Request Broker (ORB)
- Interface Definition Language (IDL)
- Common Data Representation (CDR)
Object Request Broker (ORB)
The Object Request Broker (ORB) is the central component of COBRA. It is responsible for managing the communication between the clients and the servers. The ORB provides the following services:
- Object registration and location: The ORB keeps track of the objects available in the system and their locations.
- Object activation and deactivation: The ORB activates and deactivates objects as required by the client requests.
- Message routing: The ORB routes the client requests to the appropriate server.
- Data marshaling and unmarshaling: The ORB converts the data from the CDR format to the native format of the client or server.
- Object persistence: The ORB provides mechanisms for storing objects in a persistent state.
- Security: The ORB provides security services such as authentication and access control.
Interface Definition Language (IDL)
The Interface Definition Language (IDL) is a language used to describe the interfaces of the objects in the system. The IDL is used to define the operations that an object provides and the data types it uses. The IDL is independent of any programming language and is used to generate code in different programming languages. This allows clients and servers written in different programming languages to communicate with each other.
The IDL is used to define the following:
- Interface definition: The IDL defines the operations and the data types of the interface.
- Object reference: The IDL defines a unique identifier for each object.
- Data types: The IDL defines the data types used in the interface.
- Exceptions: The IDL defines the exceptions that can be raised by the operations.
Common Data Representation (CDR)
The Common Data Representation (CDR) is a standard format used to transmit data between clients and servers. The CDR is independent of any programming language or hardware architecture. The CDR defines the following:
- Data types: The CDR defines a set of basic data types that can be used in the interface.
- Data representation: The CDR defines the binary representation of the data types.
- Data alignment: The CDR defines the alignment of the data in memory.
- Endianness: The CDR defines the byte order of the data.
Advantages of COBRA
- Interoperability: COBRA provides a standard way for applications written in different programming languages and running on different operating systems to communicate with each other.
- Scalability: COBRA provides mechanisms for distributing objects across multiple servers, which allows the system to scale up as the load increases.
- Modularity: COBRA allows objects to be developed independently and then integrated into the system.
- Reusability: COBRA allows objects to be reused in different applications.
- Platform independence: COBRA is independent of any hardware or software platform, which allows the system to be deployed on different platforms.
- Security: COBRA provides mechanisms for securing the communication between the clients and the servers, including authentication and access control.
- Flexibility: COBRA allows the system to be modified and extended without affecting the existing components.
Disadvantages of COBRA
- Complexity: COBRA is a complex technology that requires a significant amount of expertise to develop and deploy.
- Performance: The overhead of the middleware can affect the performance of the system.
- Cost: COBRA requires a significant investment in terms of hardware, software, and expertise.
- Integration: Integrating legacy systems into a COBRA-based system can be challenging.
COBRA Implementations
There are several implementations of COBRA, including the following:
- CORBA: The Common Object Request Broker Architecture (CORBA) is the most widely used implementation of COBRA. It is a standard developed by the Object Management Group (OMG). CORBA provides a set of standard interfaces and protocols for distributed objects.
- Java RMI-IIOP: The Java Remote Method Invocation over Internet Inter-ORB Protocol (RMI-IIOP) is a Java-based implementation of COBRA. It allows Java objects to communicate with non-Java objects using the COBRA standard.
- Microsoft DCOM: The Distributed Component Object Model (DCOM) is a Microsoft-based implementation of COBRA. It allows objects to communicate across different processes and machines using a binary protocol.
Conclusion
COBRA is a middleware technology that allows applications written in different programming languages and running on different operating systems to communicate and interact with each other. COBRA provides a standard way for developers to create distributed systems that are interoperable, scalable, modular, reusable, platform-independent, and secure. However, COBRA is a complex technology that requires a significant investment in terms of hardware, software, and expertise. There are several implementations of COBRA, including CORBA, Java RMI-IIOP, and Microsoft DCOM.