0

hi guys:)
i have a big problem:-/
now i have a program that have a client class and model (in mvc)
then the problem is that
1-i want the client when something comes from server to inform the model
2-i want the model if any change has been made in it to inform the client
well i think it is a command pattern
but i don't know where to put these statements ?:?:

Receiver receiver = new Receiver();
      Command command = new ConcreteCommand(receiver);
      Invoker invoker = new Invoker();
 
      // Set and execute command
      invoker.SetCommand(command);
      invoker.ExecuteCommand();

please if anyone have any idea please share it and thanks a lot

2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by RehabReda
0

As I read it, you already mentioned MVC. View tells controller, controller updates model (or vice versa).
MVC is the pattern.
In addition, Observer can be used, where client subscibes to model and model notifies client(s).
There are java and php samples at http://www.fluffycat.com/Java-Design-Patterns/

thanks padtes alot but how the client can notify the model???

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.