Software design pattern MVC window creation strategies
I would like to hear some opinions on window strategy creation with MVC. I'm writing a game and I want to integrate MVC into it.. And one of the questions I have is should I create all the windows and register them within controller o开发者_运维问答n the start of the application and fill them when appropriate event is fired or should I create them along only when they needed? If I should create the windows only when it needed, who should be in charge of creation?
Thanks in advance, Serhiy.
I'd create them as they are needed and let the Controller be in control of creating the window.
you can consider the Swing's architecture, a modified MVC.
http://java.sun.com/products/jfc/tsc/articles/architecture/
- Create the model
- Create the controller
- Link controller to model.
- Create view
- Link view to model.
- Link view to controller.
精彩评论