lundi 4 janvier 2016

JavaFX: MVC naming conventions

I am building a library and (I think I am ) following MVC.

  • Model defines the specs/instructions.
  • View interprets the instruction to create a visual that is added to the scene.
  • Controller provides a GUI (Java controlsv ie. Sliders) through which the user changes the model.

So the library is organised as: Controller -> Model -> View

Wrt naming conventions, should the class names reflect the functional role of the class in the library: for example, ShapeView, or should it reflect its actual class types (ShapeGroup)? Currently I am going with roles.

In this case, ShapeView interprets instructions from a ShapeModel class and creates shapes, then adds them to a group. The ShapeView/Group is then added to a Pane.

I realise this is probably one of those questions where there is not a definitive one right answer. So I am seeking wisdom from experts.

Aucun commentaire:

Enregistrer un commentaire