Let the Application Flow Organize Your Objects
No doubt for a simple application like the one for FlowDemo, the elaborate flow and focus mechanism is an overkill. On the performance side, as long as the focus and flow are in the same JVM, there is not much performance penalty. However, the big plus you can see very clearly is how a separation of concerns has been maintained here. For example, when setting up a listener you don't care what the position of the button or list was or when buttons were set up; you don't need to care about panel layout, and so forth. Thus, this example establishes Flows and Focus concepts.
If you look upon an application as a collection of flows, then the integration and testing of these applications is much more streamlined. First, for testing purposes, each focus object can have its own assertion clause and can be individually tested. Application integration will immdiately equate to mapping application flows to business flows resulting from the integration and vice versa. This will represent a more direct approach to application integration.
In the meantime, feel free to reuse the Focus and Flow classes and let me know what interesting flows and their context you arrive at. I have not seen too many references to the issue of flow representation within an application except the fact that applications do have flows. One recent article points to the benefit of treating the flows as representable entities.
To download the demo click here.
"Decoupling Application Logic, Persistence, and Flow: The Model Technique" by Michael Nash in www.developer.com/design/article.php/3306961.
About the Author
Pronob has been a software developer working at Visual Analytics, Sydney. He holds a MS in Applied Mathematics from Calcutta University and a MSE in Computer Science from IISC Bangalore,India. During the 22 years of software development assignments he has worked mainly on the mainframe and midrange platform software and application architecture areas. Since 2001 he has adopted java as his pet language after having been certified by Sun.
# # #
Page 2 of 2