I couldn't find any useful info about that. I wish to create a coplex objects from controls of a form-like UI - TextFields
for numbers and strings and ComboBoxes
for enums. Also, with a RadioButton
group I have to be able to lock some of the controls and unlock anothers to create similar objects which inherit from the same base class. There's a big probability that the UI will change, either the object's properties, so I have to separate View from Model (or just UI from application's logic) to prevent from writing everything from the beginning because of the need of changing one of these two.
Are there any good practices, tools, classes etc. which help to write such a code in an elegant way using JavaFX? I'm not an experienced developer, but I heard that there are terms like DI or frameworks like Spring which may help. Unfortunately that must be something that I'm missing, because I have a completely no idea how to use such a things in my project, since it's not a web application.
I'll provide a real-life example to make it more clear:
I have a device which communicates with my PC by a serial protocol. On a device, there are various modes with various parameters which perform a specific actions regarding to the modes and parameters chosen.
In a PC application I must fill the form to choose a specific mode and then fill its parameters (some are numbers, some enums, etc.). What I excactly want to achieve is that after filling all the TextFields and setting RadioButtons / ComboBoxes to the proper option and after clicking a single button with a text, let's say "Create a Mode", the MyMode
object is created from the info provided by the user. And then, this MyMode
object is used in another window for another thing. Somewhere else user may choose many modes which will later be presented next to another and which could be run on a device.
I'd like not to perform more actions than necessary to create and pass the MyMode
object further. Problem is that I don't know where is the border between "you can make it in a Controller
class" and "this is prohibited in Controller
class". What I'm thinking about is to bring over all the information from the form and by using that information create an object with as few lines of code as it is necessary.