In a Swing app, the best way to send data (interaction) between two views?
Looking at the communication session in SCJP 6 Study Guide , he says:
All non-trivial OO applications are a combination of many classes and interfaces work together. Ideally, all interactions between objects in the OO system should use the API, in other words, contracts, corresponding classes of objects.
If I understood this correctly, the best way would be to create interfaces (contracts) for each view and, if necessary, use these interface methods to extract data. Is this a good way? Have a good time creating many interfaces to say what is visible on the screen, ok?
Another way that I think is to have classes for storing data (models) of the view. In this case, is this a good approach to accessing directly these classes of models?
Thanks in advance.
source share