Skip to main content
broken link fixed, cf. https://meta.stackoverflow.com/a/406565/4751173
Source Link

It's been a long time ago since I last used an MVC approach in Swing, but I immediately notice some things I wouldn't do.

  1. Don't use a singleton, singletons are evil!singletons are evil!
  2. Passing view components to the controller? When I do MVC, I tend to pass the controller to my view elements, preferably just an interface. The view can request actions on the controller. This allows for total decoupling of the view. So you can also switch to something else than Swing. This probably isn't the 'default' approach of MVC with Swing however.

So yeah, it seems I would agree with you. Perhaps try looking for other MVC examples with Swing. This article doesn't look particularly appealing IMHO.

It's been a long time ago since I last used an MVC approach in Swing, but I immediately notice some things I wouldn't do.

  1. Don't use a singleton, singletons are evil!
  2. Passing view components to the controller? When I do MVC, I tend to pass the controller to my view elements, preferably just an interface. The view can request actions on the controller. This allows for total decoupling of the view. So you can also switch to something else than Swing. This probably isn't the 'default' approach of MVC with Swing however.

So yeah, it seems I would agree with you. Perhaps try looking for other MVC examples with Swing. This article doesn't look particularly appealing IMHO.

It's been a long time ago since I last used an MVC approach in Swing, but I immediately notice some things I wouldn't do.

  1. Don't use a singleton, singletons are evil!
  2. Passing view components to the controller? When I do MVC, I tend to pass the controller to my view elements, preferably just an interface. The view can request actions on the controller. This allows for total decoupling of the view. So you can also switch to something else than Swing. This probably isn't the 'default' approach of MVC with Swing however.

So yeah, it seems I would agree with you. Perhaps try looking for other MVC examples with Swing. This article doesn't look particularly appealing IMHO.

Source Link
Steven Jeuris
  • 2.7k
  • 3
  • 21
  • 34

It's been a long time ago since I last used an MVC approach in Swing, but I immediately notice some things I wouldn't do.

  1. Don't use a singleton, singletons are evil!
  2. Passing view components to the controller? When I do MVC, I tend to pass the controller to my view elements, preferably just an interface. The view can request actions on the controller. This allows for total decoupling of the view. So you can also switch to something else than Swing. This probably isn't the 'default' approach of MVC with Swing however.

So yeah, it seems I would agree with you. Perhaps try looking for other MVC examples with Swing. This article doesn't look particularly appealing IMHO.