Professional Documents
Culture Documents
Lec 3-1
Lec 3-1
Lecture three
1
What is CORBA?
Common Object Request Broker Architecture
2
Who should use CORBA?
3
CORBA Features (1)
Heterogeneity
- Hardware devices
- Operating System
- Network protocols
- Programming languages
Object Orientation
- Encapsulation
- Polymorphism
- Inheritance
- Instantiation
Dynamic binding and typing
4
CORBA Features (2)
Transparencies
- Location transparency
• the physical address of a server is masked
- Access transparency
• the access method is masked
- Data transparency
• the different data representations are masked
- Replication transparency
• the server replicas are masked
- Migration transparency
• the migration of a server is masked
- Activation transparency
• the activation of a server is masked
5
CORBA Objects
6
CORBA Architecture
7
Object Request Broker (1)
Responsibilities
Object location transparency
- Find the object implementation for the request
Object activation
- Prepare the object implementation to receive the request
Communication
- Communicate the data making up the request
8
Object Request Broker (2)
10
Generic Architecture
Client Server
Object Object
Middleware
11
CORBA Architecture
Remote-object: object implementation resides in server’s
address space
Client Server
Java Object
C++ Object
Skeleton
Client Server
Java Object
C++ Object
Skeleton
13
Skeleton
Provides iterface between server object and ORB
Unmarshaling: client invocation
Marshaling: server response
Client Server
Java Object
C++ Object
Skeleton
14
(Portable) Object Adapter (POA)
Register class implementations
Creates and destroys objects
Handles method invokation
Handles client authentication and access control
Client Server
Java Object
C++ Object
Skeleton
15
Object Request Broker (ORB)
Communication infrastructure sending messages between
objects
Communication type:
- GIOP (General Inter-ORB Protocol)
- IIOP (Internet Inter-ORB Protocol) (GIOP on TCP/IP)
Client Server
Java Object
C++ Object
Skeleton
16
CORBA Object
Server
CORBA
Interoperable Object Reference
Object
Interface C++/Java
IDL Implementation Servant
17
Interface Definition Language (IDL)
Describes interface
Language independent
Client and server platform independent
Server
CORBA
Interoperable Object Reference
Object
Interface C++/Java
IDL Implementation Servant
18
19
Example of CORBA Services
20
Distributed Component Object
Model (DCOM)
Designed by Microsoft
Based on Component Object Model (COM)
Addresses issues such as:
- Interoperability
• Different applications, platforms, languages
- Versioning
• Compatibility between a new version of a server and old
versions of clients
New interfaces should preserve the old interface
- Naming
• Use Globally unique identifiers
21
DCOM Properties
Status reporting
- Of remote execution using HRESULT struct
22
DCOM Services
23
CORBA vs. DCOM (1)
24
Sockets Programming
Client-Server Computing
What are Sockets
Sockets Programming in Java
Programming Examples
25
What is a socket?
Higher-level techniques
27
Client/Server Computing
Simple idea:
Some hosts (clients, typically desk top computers) are
specialized to interact with users:
- Gather input from users
- Present information to users
Other hosts (servers) are specialized to manage large data,
process that data
The Web is a good example: Client (Browser) & Server
(HTTP server)
28
Client/Server Computing
Other examples:
- E-mail
Server Client
Client
29
Sockets
30
- An analogy:
Socket: telephone
Read/write: talking
Close: ???
31
To send:
- Socket, connect write
To receive:
- Socket, bind, listen, accept read
TCP endpoint:
- IP address + port number
32
Ports
33
Objectives
Goal:
- How application programs use protocol software to communicate
across networks and internets
Introduction to Client-Server paradigm of interaction
34
Transport layer and layers below
- Basic communication
- reliability
Application Layer Functionality
- Abstractions
- Names:
• define symbolic names to identify both physical and abstract
resources available on an internet
35
Network
- transfers bits
- operates at application’s request
Application determines
- what/when/where to send
- Meaning of bits
=> Application programs are the entities that communicate
with each other, not the computers or users.
36
Client/Server Model
How 2 application programs make contact
Server Client
•Starts first •Starts second
•Passivelywaits for •Actively
contacts a
contact from a client at server with a request
a prearraanged
location •Waits for response
from server
•Responds to requests
37
Characteristics of a Client
38
Characteristics of a Server
Special-purpose, privileged program
Dedicated to providing one service
Can handle multiple remote clients
simultaneously
Invoked automatically when system boots
Executes forever
Needs powerful computer and operating system
Waits passively for client contact
Accepts requests from arbitrary clients
39
Terminology
Server
- An executing program that accepts contact over the network
server-class computer
- Hardware sufficient to execute a server
Informally
- Term “server” often applied to computer
40
Direction of Data Flow
41
The Socket Interface
=
Internet file.dat
42
Socket Types
43
Connectionless Client
Service (UDP) 1. Create transport
endpoint: socket()
Server
2. Assign transport
1. Create transport endpoint an
endpoint: socket() address (optional):
bind()
2. Assign transport
endpoint an 3. Determine address
address: bind() of server
CONNECTION-ORIENTED SERVICE
2. Assign transport
2. Assign transport
endpoint an
endpoint an
address (optional):
address: bind( )
bind( )
3. Announce willing
to accept connections: 3. Determine address
listen( ) of server
46
Sockets and Ports
message
client server
other ports
47
Java API for TCP Streams
48
Java API for TCP Streams
Socket:
Socket (InetAddress address, int port) - Creates a
stream socket and connects it to the specified port
number at the specified IP address. It will throws
UnknownHostException or an IOException.
getInputStream - Returns an input stream for this
socket.
getOutputStream - Returns an output stream for this
socket.
49
Error Handling
50
Client side script
String temp=BR.readLine();
PRSM.println(temp);
String s=get.readLine();
System.out.print(s);
51
Server side script
52