This discussion is archived
1 Reply Latest reply: Feb 5, 2013 6:27 AM by 956927 RSS

Achieving thin controllers

800584 Newbie
Currently Being Moderated
I am getting my feet wet with javafx. This is what I am doing.

- FXML Views
- DI Controllers
- Weld-SE Managed Services and Models
- Trying to confine UI to FXML
- Trying keep the Controllers thin

Problem:

While trying to code the UI, most static UI is confined inside the fxml. But there are scenarios where I find my self adding, removing, showing, hiding elements etc.

I find myself doing this inside the controller as fx lets me configure controller method in the view which it will call on a particular action / event. All this code deals with Dynamic UI building / manipulating and belongs inside the view layer. But, it ends up in controller making the controllers fat.

javafx provides javascript integration. This is one possible way to abstract that view manipulation code away. But this would add not so perfect JavaScript into the mix.

How would I abstract the code away in java or fxml so that I don't break the Thin Controller Paradigm ?

Legend

  • Correct Answers - 10 points
  • Helpful Answers - 5 points