EDIT: linked old topic - http://www.jmonkeyengine.com/jmeforum/index.php?topic=2279.0
I’ve been playing with the RubiksCube.java found in the forum for some time now.
My concern now is to use the jME code only for display, that is in a MVC fashion being only the View part.
Basically i want to have :
- Main.java to instanciate controller Core.java
- Core.java to instanciate DataModel and View (jME)
- Main to start controller
Actually i want my Controller and DataModel to be able to work w/o any display, thus separating the jME logic. jME should only respond to messages like "rotate this like that".
Input controls are on a separate JPanel interacting with the controller.
Any clue how to separate all that and make it quite modular?
Good post, entirely agree with your intention.
I think in terms of composition rather than agregate, the composite will be a GUI type object that is specific for a JME graphics front end. The composition has normal data objects ( such as cube ) and it has reference to the node which holds the cube.
When the user selects to rotate ( by button or dragging on the cube ), the normal data objects are updated and then and action or whatever you decide updates the graphics.
this is my approach anyhow. Think hevee has seperated his content in a similar way…
i did some coding this night but its 4am }:-@ so i'm going to sleep a bit before doing some Delphi @office lol
I've managed to split code in a what i find to be a good way, i'll tell more about this tomorrow with fresh ideas (hopefully…).