rocketmail / jfxflow

Automatically exported from code.google.com/p/jfxflow
0 stars 0 forks source link

Question: How to work with overall state information ? #3

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
Hi Zonski,

I would like to know what is in your opinion the best (or at least, a good) way 
to handle overall information/state ?

What do I means with this ?

At Page1 you click within a table a row with some data. This will cause a 
forward to Page2 and you need this chosen data there.

I could do this with a Singleton and store the data there and use it then on 
Page2. But maybe there is a better way you planned for doing so.

What is your recommendation ?

Cheers, Rob.

Original issue reported on code.google.com by robert.w...@web.de on 30 Nov 2011 at 7:37

GoogleCodeExporter commented 8 years ago
Hi Rob, 

Definitely a big no on the singletons! :)

There is a mechanism in place in JFX Flow for passing parameters between 
activities and activating it with those parameters each time you navigate to 
the activity. This combined with dependency injection of 'lookup' objects, such 
as references to remote services or databases is what I would recommend.

Your question has triggered me to finally write another page of docco on JFX 
Flow. Please check out: 

http://www.zenjava.com/jfx-flow/jfx-flow-user-guide/passing-parameters-to-activi
ties/

If you still have any more questions, don't hesitate to post back here with 
them. 

Cheers, 
zonski

Original comment by zonski on 30 Nov 2011 at 2:28