|
From: Jamis B. <jg...@em...> - 2003-12-12 19:44:32
|
Hans Fugal wrote: >In summary, the replicator is the gate to the model. The view and >controller get to the model (set of objects) via the replicator. Views >register as observers to keep up-to-date. > > This sounds a lot like what I did for Penny Pincher (a Swing-based financial tool I've been working on: http://penny-pincher.sf.net), at least as far as the observers. I created a DatabaseEventMediator, and anytime anyone changed the database in anyway, they notified the DEM and told it which table and record (or records) were modified. Then, any objects that were registered listeners on the given table were notified of the change. Works quite well. >On the MVC issue, can anyone give me a good reason why view and >controller are separate? Some suggest tightly coupling them and I really >am having a hard time figuring out the benefit in keeping them separate. > > For what it's worth, Danny and I have been taking 456 (GUI's) this semester, and Dr. Olsen is of the opinion that there is no added value in separating the view from the controller. He said that it used to be done, but caused a lot more complexity for few additional benefits. Also, he said that the only reason for separating the view from the controller is if you want to reuse the controller or view independently of one another (ie, attach the same view to a different controller, or vice versa). This happens extremely rarely. - Jamis -- Jamis Buck jg...@em... ruby -h | ruby -e 'a=[];readlines.join.scan(/-(.)\[e|Kk(\S*)|le.l(..)e|#!(\S*)/) {|r| a << r.compact.first };puts "\n>#{a.join(%q/ /)}<\n\n"' |