Cydia Substrate cydia tweak is a powerful code insertion platform.
The general idea is that there are a number of reasons one might want to hook functionality into an existing application. In order to do this there are a few dangerous or complex steps. By centralizing the code for these we can hope to get them right.
As an example, MobileSubstrate provides a simple platform (one integrated with Cydia) for deploying code that gets inserted into graphical applications. When things fail, it is able to provide error handling and fallback support (think of a “Safe Mode”).