November 21, 2011
[Video] Coding Session #12: Reusable Workflow Considerations
In a previous coding session we've talked about what makes effective reusable code. In this coding session, we're going to take the same concept and apply it to workflows.
For a list of principles, I think the list from our reusable code session still applies:
1 Not a one-off, expected to be reused
2 Does a discrete, focused task
3 Returns consistent results
4 It is adaptable
5 It handles defaults gracefully
6 It handles errors gracefully
7 It is documented
8 It is easy to find
Reusable workflows differ from reusable code in that workflows usually contain quite a bit of code and UI components where reusable code is easily defined by a method or two. So let's add the following principles to the list:
1 "Easy" to include in a project
2 Self contained -- no hard links to outside code
3 API and/or meta data interface to interact with outside context
4 Good UI for all workflow functionalities
5 Knowing what and what not to include
Being able to combine reusable code and workflows in various projects is a powerful productivity advantage.
To demonstrate, in this session we work through these concepts as applied to a module we've created for sending out batch emails. This module is one of the oldest we have in our toolkit and it has been some time since I've used it on a project.
Let's see how this "Campaigns" module stacks up with our current approach to reusability and see if we can make it work in the context of today's task -- automatically sending out emails from a web form submission.