Will Implicit Invocation Continue to be Important in Controllers?
The purpose of implicit invocation is to provide a level of indirection by decoupling an event from the code that needs to be executed on that event. While it can arguably make an application a little harder to debug, it can also make it much DRYer by allowing the same listener to be associated to multiple events and to allow for the decoupling of more complex flows. To take a simple example, if an “add product” form is validated successfully by the model, you may want to redisplay the product list. With II, you can just fire off a “ProductList” event so the same product list listener (which calls ProductService.getProductAdminList() and then sets the screen to display to “ProductList”) can be reused rather than being replicated . . .
The simple use cases for II will continue to be valid and II may well still be a valid approach to controllers, but I’m just wondering out loud what some of the key use cases for II would be if you had portal aware, continuation supporting controller features and were developing multi-mode applications (HTML, Flex and Web Service APIs) which had to keep all of the business logic firmly in the model.
Multi-Mode
I am just wondering out loud how many of the “hard” problems being solved by II are problems that arguably should be contained within the model. Easy answer: if you added a Flex front end calling your business service layer via a remote facade, would you have to re-create any of your controller logic in the model? For example it seems to me that things like firing off notifications on events should indeed use II, but should be within the model not within the controller as I don’t care whether I bought from you using your Flex shopping cart or your HTML one – I still want you to email me a confirmation of my order!
Continuation Supporting
If we had stateful continuation server features built into an orchestration layer in the model, do we NEED II? Most of the event logic will be handled by the continuation server in the model.
Portal Aware
If our controllers were fundamentally multi-component/portal aware so you didn’t have to use filters or plug-ins (or other approaches) to populate your secondary content areas, would that reduce the need for II?
The Big Question
So in LightBase, I’m adding multi-content area support using a pseudo page controller and multiple content areas/components per page. I’m building in some kind of continuation server/worklow/stateful aware generator for the orchestration layer within the model. I’m also assuming that every application will need to support web service, Flex and HTMl interfaces to the model so I’ll be providing features like Implicit Invocation support within the model itself for firing off notifications and the like (probably using AOP when I add it to LightWire). Given all that, should I add an II level of indirection to the object controller or not and if so, what kind of use cases would it support?
Any input wildly appreciated :->



There are no comments for this entry.
[Add Comment]