Do i need a Mediator class to create Model, View and Contoller object and set up their relationship ? Or Contoller class can do this job ?
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
The Sun Certified Java Developer Exam with J2SE 5: paper version from Amazon, PDF from Apress, Online reference: Books 24x7 Personal blog
Strict MVC does require all three participants.
The problem that I am worried about, is that in one discussuion, somebody said that Contoller MUST have a reference to the view.
I thought that good MVC should decouple View from Controller, what I have done.
My View creates GUIContoller object.
My GUIContoller creates table Model object.
my view has reference then to the controller and get references to the Table model througg the GUIContoller.getTableModel() method.
So, My contoller doesn't have any reference to the View.
Are you sure it is Ok?
I would prefer, let some other class create view and controller object.
In real world also these are created by some one else
public class ConnectionProps{
private java.util.Properties props = ...
public ConnectionProps(){
...
}
public void setIp(String port){
props_.setProperty("client.serverport", port);
}
}
So this model(in Swing) allows to become observable. But in bean, typically we do not see this method. Am i right ?
I don't get it. A whale wearing overalls? How does that even work? It's like a tiny ad wearing overalls.
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|