Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

UB MVC for Network and stand alone

 
Jeff Hinshaw
Greenhorn
Posts: 21
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using the MVC design pattern for the UrlyBird assignment. Following is generic explanation of my Model portion of the MVC pattern.

<code>
interface UBModel extends Remote
</code>

When running as standalone:
<code>
UBModelImpl implements Model.
</code>

When running as network:
<code>
interface UBServer extends Remote, UBModel
UBServerImpl extends UnicastRemoteObject, implements UBServer and
has a UBModelImpl
</code>

The Model notifies the views of changes to the Model. So, do I need two implementations of the View as well? One extending UnicastRemoteObject, and one that does not?

Thanks in advance.
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12008
216
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Jeff,

Normally the only classes that need to extend UnicastRemoteObject are those that will be called remotely. So if your MVC Model is extending UnicastRemoteObject then you are implying that it will be called from the server. Is this correct?

There may be a reason for having your server call the MVC Model, but there would normally be no reason to have your server call the MVC View. So there should be no reason for having the view extend UnicastRemoteObject.

Additionally there is the following statement in the instructions: "Architecturally, [standalone] mode must use the database and GUI from the networked form, but must not use the network server code at all." So, assuming the View and Controller of your MVC form the GUI (which is normally the case), then you must only have the one View.

Regards, Andrew
[ October 08, 2005: Message edited by: Andrew Monkhouse ]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic