What is the controller in Java Swing?

前端 未结 7 820
不知归路
不知归路 2020-12-23 10:38

I would like to apply the MVC design to my Java application using Swing in a meaningful way. Therefore my question is, how the controllers would be structured in Java Swing?

7条回答
  •  难免孤独
    2020-12-23 11:29

    Platzhirsch,

    Dude, this a SERIOUSLY heavy-weight question... one which nobody is going to answer adequately in a forum post. This artice Java SE Application Design With MVC by Robert Eckstein (one of the Java Gods) discusses the problem at length.

    Personally, I ended-up using a "variant" of MVC which I called MBVC (Model Business View Controller), which is actually pretty close to MVVMC... MVVM is widely used in .NET cirles; adding a controller made sense to me, as I had some web MVC experience. I wish I'd read the above article BEFORE I set-out to MVC-ise my app. You can still read my rather perplexed posts on Sun's (now Oracle's) Java forums.

    Cheers. Keith.

提交回复
热议问题