File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Architect Certification (SCEA/OCMJEA) and the fly likes moving state vs. behavior Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Certification » Architect Certification (SCEA/OCMJEA)
Bookmark "moving state vs. behavior" Watch "moving state vs. behavior" New topic
Author

moving state vs. behavior

Jeff Belisle
Ranch Hand

Joined: Jun 11, 2006
Posts: 39
Q: you need to move state of the object but not its behavior. Which frameworks will you use?

1.)HTTPS
2.)Corba
3.)RMI
4.)JRMP
5.)IIOP

Answer: B. Corba only moves an object's state.

I dont see a difference between Corba & RMI from this perspective.
Please comment.
Cameron Wallace McKenzie
author and cow tipper
Saloon Keeper

Joined: Aug 26, 2006
Posts: 4968
    
    1

I'm not a CORBA expert, but I did sleep at a Holiday Inn last night.

From what I understand, CORBA can move an entire object across a network connection, sorta like sending a serialized JavaBean across a network connection. In that manner, CORBA is transferring the entire state of an object, not just it's methods.

With Ur...Uhm...Eye..., RMI, you' are simply allowing an objects methods to be invoked remotely, thus obtaining access to the behavior of the object, as opposed to the state of the object.

-Cameron McKenzie
Jeff Belisle
Ranch Hand

Joined: Jun 11, 2006
Posts: 39
Originally posted by Kameron McKenzie:
I'm not a CORBA expert, but I did sleep at a Holiday Inn last night.

With Ur...Uhm...Eye..., RMI, you' are simply allowing an objects methods to be invoked remotely, thus obtaining access to the behavior of the object, as opposed to the state of the object.

-Cameron McKenzie


How about a RMI object which does not implement remote interface.
An entire copy will be sent including state & behavior.
Ådne Brunborg
Ranch Hand

Joined: Aug 05, 2005
Posts: 208
Consider the acronyms:

Common Object Request Broker Architecture (CORBA)
Remote Method Invocation (RMI)

One is for sharing objects, the other is for calling method on remote objects. CORBA is saying "this is how the object looks like now" (i.e. state) whereas RMI says "you could have the object do this" (i.e. behaviour).

I don't understand what you mean by "a RMI object which does not implement remote interface" - if it does not expose an interface which could be accessed from a remote client, how can it be a RMI object?


Entia non sunt multiplicanda praeter necessitatem
Jeff Belisle
Ranch Hand

Joined: Jun 11, 2006
Posts: 39
Thanks!! The acronym thing makes sense. Although, I dont think it is a quality question.

"RMI object which does not implement remote": I mean an object which is a return parameter of a remote method. So when a client gets that object it gets that objects state as well as behaviour.
Ådne Brunborg
Ranch Hand

Joined: Aug 05, 2005
Posts: 208
Ah. Now I understand what you mean.

Consider the following code:



This code deals with two classes - MyRmiClass and Integer. If I understand you correctly, Integer would what you call "RMI object which does not implement remote".

This is a "marshalled object" (java.rmi.MarshalledObject) - the object sent between JVMs. The term "RMI object" (althought the techincally correct term would be "remote object) refers to an object available for remote method invocation, and is not applied to objects used as parameters.

Suggested reading: RMI spec
2.2 Definition of Terms In the Java platform's distributed object model, a remote object is one whose methods can be invoked from another Java virtual machine, potentially on a different host. An object of this type is described by one or more remote interfaces, which are interfaces written in the Java programming language that declare the methods of the remote object.

Remote method invocation (RMI) is the action of invoking a method of a remote interface on a remote object. Most importantly, a method invocation on a remote object has the same syntax as a method invocation on a local object.



Hope this helps.
[ October 17, 2006: Message edited by: �dne Brunborg ]
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: moving state vs. behavior