There are a few strategies to consider, all involving ensuring independence of background intelligence from GUI code. Advantages are that the boundary between the main functions and the GUI is well defined, and it is easy to replace particular background modules. Advantage is also related to boundary between GUI and support code, and ability to replace particular background modules.
Disadvantage is that implementation of run time libraries is system and compiler dependent.
This is easier to implement than the previous approaches, but also has disadvantages such as big executable files, and the need for a complete rebuild to maintain the background code. That means this approach relies of programmer discipline to ensure clean separation between GUI and implementation. The problem is that implementing that scheme introduces trade-offs.