I'm thinking of implementing MVP - Inactive view patterns in JavaScript. In most cases the scene will be simple domain elements where the presenter events attach to the listeners. But when it comes to javascript based pseudo selection boxes, auto suggestions or widgets like ARIA, should it be a part of the Javascript view class or should the logic of changing viewers' viewpoint be rational? I have seen and it seems that they are just generating HTML of the template without any arguments but for me there is no separation between the presenter, who listens to the HTML selection box and to copy a real selection box For pseudo-selection box with javascript logic hears. Both should not care about how the box is working internally, they have to hear the incident of change.
So what do you think is a work class.
The visual work is in the form of visual technology, in this case, your view technology is HTML There is a possibility of javascript via The scene should be designed to do three things:
- When events occur, know and the presenter may have these incidents (this indirectly, such as using a framework to send messages).
- Tell the presenter (when asked) what is the value of " x " where x is the value shown in the view.
- Accept messages from the presenter (usually via direct method call) to change the values of the views.
A view in the passive visual pattern is not stately ; I repeat, does not represent a visual state This means that All the states and knowledge of state change are represented by the presenter. This view is only glue which provides misconduct between the presenter and the real-view technique. Beyond the three bullet points given above, there is no knowledge of what to do with the information contained in it. This is important because you should never think that they are in a consistent position. You should always catch the presenter responsible for managing the situation of the scene.
The above stacks show that I Interacting with models, views and presenters, as well as seeing their relationship with vision technology and controller.
- Browser, HTML, and DOM (managed through jQuery) are visual techniques These are inherently complex, and are unable to represent your model.
- Views prevents your logic from visualization technology This provides indirection so that you can see plain old code in your presenter To focus on The sender should use to communicate back in any type of message that prevents bidirectional dependency between the view and the presenter. It also allows many presenters to manipulate an exhibitor.
- The presenter should be responsible for understanding the essence of view, and the model state has been seen on its interface basis. It is able to understand how to retrieve the model from the contoller, and how to stay back to the model server.
- The Controller and Presenter Between DTO also can work as Javascript, it is easy and sometimes it is better to add presenter behavior to model .
- Controller syncs navigation within the app, and is responsible for separating back-end services from the presentation.
Comments
Post a Comment