JavaFX and Clojure: binding observables to immutable objects -


I'm trying to figure out the approach to allow a JavaFX TableView (or some other JavaFX talk) Closer allows data, and allows the user to manipulate data via GUI.

For this discussion, suppose I have a list / vector, such as [{: col1 "happy1": Col2 "sad1"} {: col1 "happy2": col2 " Sad2 "}] and I want to display it in a graphical table:

  mykey1 mykey2 - ----------------- Happy 1 sad1 happy2 sad2  

Beautifully it has been a ghazalian times in the history of the world.

The problem is that Tableview emphasizes on taking an Observatory List, etc., which is inherently an inefficient thing, as in Java FX all the Observables. It's great to keep the table up to date, and in a temporary model, it's great to allow a user to manipulate data directly through the GUI. I am not an expert, but in this case it seems that JavaFX wants the GUI object to actually contain the actual data. It looks strange (no ha ha) to keep my own model and to communicate between the GUI and the model through some API or interface also means that I keep the data in two places I: In my own model, and in the GUI. Is this the right way to do the job? Maybe it's okay because the GUI only displays a small fraction of the total data, and this makes my model data normal model data, not an example of some Java-derived type.

So this clue when you try to put a GUI on a stateless / non-changable model for the following three common questions:

  1. Do you want to change things Can allow, so how can actually be irreversible? I'm thinking of any kind of design tools, editors, etc., where the user changes obviously things, for example, lighttable is an editor, yet the story is about the temporary data based on. How is this possible? I am not interested in the FRP for this discussion.

  2. At least one of the atom or other closing volatile type (referee / var / agent / etc) (regardless of a single Atom has an entire in-memory design database, or what is an irreversible list of what is the database database of instability Atoms ) [MVP, MCP, MVVM, etc.] Is the best for

  3. Java fx class hierarchy with each conceivable change of perceptual interface), with gems such as observation (whatever) value , example For ObservableMap and ObservableMapValue , and then dozens of implementation classes such as IntegerProperty and SimpleIntegerProperty ... yes! WTF? Assuming that I create some close object ( defrecord , etc.) and implement the Observable interface methods on most of my most irreversible objects, do I just see the insignificant , or I click on the bottom pane node, i.e ObservableIntegerValue , etc.

Should the correct high level approach apply? Maintain a single top-level atom, which every time the user changes a value? Maintain a thousand low-level atom? My values ​​live as JavaFX Observables, and forget about Clojure data structs? Use some modified / proxy / mass-class to implement your own set observations in the closure, but apply them as irreversible, which changes every time. Is there a need or place for the Closer add-switch function? I highly appreciate that my data is just general data in the closure, not the "type" or the implementation of any interface. An integer should be an integer, etc.

Thanks

I look at an atom, and then based on diff Update Inspection


Comments

Popular posts from this blog

Member with no value in F# -

java - Joda Time Interval Not returning what I expect -

c# - Showing a SelectedItem's Property -