Professional Documents
Culture Documents
DISTRIBUTED COMPUTING
User Interface
Business Logic
Dumb Terminal
Mainframe
Database
Windows GUI
Database
Network Computer
Database
Servlets
ModelViewControllerPattern
Consistsofthreekindsofobjects Applicationobjects(Model) Screenpresentationobjects(View) Objectsmanagingthewayuserinterfacereactstouser input(Controller) BeforeMVC,userinterfacedesignstendedtolump
DistributedObjectArchitecture
Basedonanetworkcommunicationlayer y Thereare3parts:
Businessobject Stub Skeleton
10
10
11
11
RMI
RemoteObject: AddServer
RMI
JVM 1
JVM 2
Client
Server
12
12
Client
1. Client invokes a business method
Middle Tier
3. Skeleton invoke method on Business Object
RMI Loop p
STUB
SKELETON
BUSINESS OBJECT
13
Terms
Marshalling convertsobjectsintoabytestreamand
unmarshalling g reversesthep process converting gabyte y stream toanobject Objectserialization:theabilitytoconvertanobjectintoa stream t of fb bytes t th that tcanl later t be b converted t dback b ki into t acopy oftheoriginalobject Astub isaclientsideobjectthatrepresentstheremote object.Astubhasthesamelistofmethodsthattheremote objectexposestootherobjects Askeleton residesontheserversideandtakescareofall detailspertainingtotheremotenatureoftheserverside object j sothattheactualserversideobject j doesnothaveto worryabouthowtohandlethenetworklevelcommunication.
14
14
FindingObjectsinRMI
Usenamingordirectoryservice Needtofirstfindthenamingordirectoryservice Anaming gordirectory yservice isusually yrunonahost
15
StepsinDevelopingRMIApplications
DefinetheremoteinterfacefortheAddServerobject ImplementtheremoteinterfacewithAddServerImpl class Writeaclientapplicationtoinvoketheadd()methodofthe
AddServer Generatestubsandskeletons
rmic addRmi.AddServerImpl p
Writeaserverapplication Starttheregistry
start rmiregistry
16
RunServerandClientApplications
RunServerApplication:
java addRmi.AddServerApp
RunClientApplication:
java addRmi.AddClientApp 127.0.0.1 3 4
Outputs:
First number is: 3 Second number is: 4 R Result l is: i 7.0 7 0
17
17
IS2103
18