java - In HMVC how to send model change event to multiple views? -


I can see many ways to do this.

  • In the model, a controller model sends an event to this controller and the other controller passes it through the hierarchy to the viewer and < Li>

    To view changes through listeners (list of models listener) on all interested controller models

  • Listen to all interested thoughts models lets see.

    • Your third option is old school ideas Is notified by the model, and the scene decides how to handle it. It's fine but the other options are better.

    • Your second choice seems to inform the views by the controller (make sure there are different administrators to update your ideas and update the model). Therefore the controllers can modify events before going to see them. Administrators can customize the data for the scene. The scene should not do this, the job is only to show something (option is to do this in three options).

    • Your first option is a small improvement of option to filter two event premises with hierarchy, it may be better in a complex scenario but if this normall will fly out, then read it It is difficult.

      I will select option two. This simple code is the best option for business and complex tasks.

Comments

Popular posts from this blog

Python SQLAlchemy:AttributeError: Neither 'Column' object nor 'Comparator' object has an attribute 'schema' -

java - How not to audit a join table and related entities using Hibernate Envers? -

mongodb - CakePHP paginator ignoring order, but only for certain values -