D
Daniel Pitts
I'm starting a new project and was considering several different ways to
model and render my data.
1st way is it to use Swing models directly (TreeModel, TableModel,
etc...) in my domain. This seems like the worst way possible ;-)
The 2nd way is to implement a Swing model interface in a way that wraps
my domain model (eg, write a class MyTreeModel implements TreeModel that
is a bridge to MyTreeLikeStructure). This has the benefits of the data
always being "in sync" because the backing model is my domain model.
The down side is that the threading model for my domain must support the
threading model of Swing. This seems unsatisfactory to me.
A 3rd way would be to have a bridge between my Domain model, and a
default Swing model (eg, has a MyTreeLikeStructureListener which will
update the DefaultTreeModel instance as things change). This seems
like the winner, but I'm not sure about the development overhead in
this. Does anyone have experience with any of the three approaches?
Thanks,
Daniel.
x-posted to cljg and cljp
model and render my data.
1st way is it to use Swing models directly (TreeModel, TableModel,
etc...) in my domain. This seems like the worst way possible ;-)
The 2nd way is to implement a Swing model interface in a way that wraps
my domain model (eg, write a class MyTreeModel implements TreeModel that
is a bridge to MyTreeLikeStructure). This has the benefits of the data
always being "in sync" because the backing model is my domain model.
The down side is that the threading model for my domain must support the
threading model of Swing. This seems unsatisfactory to me.
A 3rd way would be to have a bridge between my Domain model, and a
default Swing model (eg, has a MyTreeLikeStructureListener which will
update the DefaultTreeModel instance as things change). This seems
like the winner, but I'm not sure about the development overhead in
this. Does anyone have experience with any of the three approaches?
Thanks,
Daniel.
x-posted to cljg and cljp