• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

MVC - Use of Observer & Observable.

 
Muthaiah Ramanathan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Inorder to implement the MVC architecture in the assignment, I would like to know whether using Observer & Observable model recomended or not.
 
David Sham
Ranch Hand
Posts: 61
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Observer pattern is of course recommended for use with MVC. However, for this assignment it may be considered out of scope. I was concerned about providing server-side callbacks to remote clients for update purposes whenever a change was made to the database file by any client. But, the consensus on this forum is that it is not necessary for this project to implement this functionality.

Again, any extra functionality you put into your project will not earn you any extra credit points - and there is the added risk of more things that could go wrong during examination if you submit an elaborate solution. Although an elaborate solution is not prohibited.
 
Muthaiah Ramanathan
Ranch Hand
Posts: 102
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have started the project without the Observer & Observable pattern, but suddenly when I saw it, I was bit confused whether to include them or not. Now that it is said to be out of scope let me not burden myself.

In that case is the following design aceptable? But I am concerned that there is no interaction with the View and the Controller.


Any clarification would be really appreciated.

[Andrew: put diagram between [code] and [/code] UBB tags]
[ May 17, 2005: Message edited by: Andrew Monkhouse ]
 
Andrew Monkhouse
author and jackaroo
Marshal Commander
Pie
Posts: 12007
215
C++ Firefox Browser IntelliJ IDE Java Mac Oracle
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Muthaiah,

There are many ways of implementing the MVC pattern. One of them has the Views registering themselves as Observers of the Model. This can work very well, especially when you have multiple views/controllers all connected to one model - any change to the data will be reflected in all the views.

Whether you should use it or not is more difficult to answer. It is more important for you to decide what benefits it will give you/might give you in the future versus what benefits will be gained by not implementing this. You can then explain your choice in your design decisions document.

Regards, Andrew
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic