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

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/

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???

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.