This tutorial presented migration strategies for a user-defined function SPADE program. You can continue your education with all 5 parts of this tutorial series. As you tackle progressively more-difficult parts of the series, your effort will go up from checking on a few minor language differences (like for punctuation) to dealing with ancillary objects, such as function models and C++ implementation files for UDOPs and UBOPs. Parts 4 and 5 of this tutorial series demonstrate progressively more-complex migration procedures that incorporate different kinds of user-defined operators (UDOPs and UBOPs).
Keep in mind the fact that these tutorial examples can only serve as a general guide for how to approach the conversion of a SPADE program to SPL. In other words, each SPADE program is different, and what is encountered during the conversion process for each can vary widely. For example, in the course of converting many other SPADE programs, you might see any of the following:
- Failures to produce any SPL source
- Source that doesn't compile
- Compiled programs that don't run properly
- Running programs that don't produce the correct results
Of significant importance is the availability of known good results from the SPADE version of the program. Once the SPL program is running, even apparently successfully, be sure to compare the former results with the new. Unfortunately, the new results will not always be good. A divide-and-conquer approach works fairly well in these cases. Both SPADE and SPL programs are easily modified through the addition of temporary file sinks. In both the SPADE and SPL versions of the program, add a new file sink to some operator in the middle of the program to record its output stream. The new file sink produces either good or bad results, which narrows the area of your search to either the part of the program before or after this new file sink. This process, repeated just a few times, usually helps you focus in on the erroneous computation fairly quickly.
None of this should frighten you away from the translation tool. It is, by far, the easiest and fastest way for someone to go from having a SPADE program to having a remarkably similar program that's now expressed in the SPL idiom. Just stay flexible and be prepared to be an active part of the migration process.