MVC and Java GUI listeners

I would like to ask, from a design point of view, whether it would be better to place listeners for the graphical interface in the “view” or “controller”. A colleague believes that the “look” is the most natural place, but I'm not sure.

+3
source share
1 answer

If you are talking about Swing, as previously discussed , MVC in Java is not clear and simple, as the template suggests. Therefore, to answer your question, it depends on how you define the “view” and “controller” in relation to a particular application, and what you mean by “placement of listeners” in one way or another.

, - (ish) ( ) ( ) . , Swing - , .. - , , , . , EJB -, Swing API -. , EJB, Swing, EJB, .

+2

Source: https://habr.com/ru/post/1788740/


All Articles