1. A method for dynamically replacing code within a software application on a device, the method comprising: a computer receiving an annotated code segment of a software application of a device that performs a function according to a first data policy, wherein: the device is capable of operating according to the first data policy and a second data policy, based upon a selection of a respective data policy received from a user of the device; each respective data policy includes a set of requirements associated with the respective data policy; the code segment is associated with a first tag indicating that the code segment performs the function according to the first data policy; and the annotation indicates that the annotated code segment can be substituted with another code segment, external from code of the software application, if the device is configured to utilize a data policy that is not the first data policy; the computer determining an alternate code segment that performs the function according to the second data policy, wherein: the alternate code segment is stored in a repository external from code of the software application; and the repository contains source code for performing the function according to various data policies; the computer causing a compiler to compile the alternate code segment; subsequent to the computer determining the alternate code segment, the computer storing the compiled alternate code segment and a second tag in a compiled code database, wherein the second tag indicates that the alternate code segment corresponds to the second data policy; the computer determining that the device is set to utilize the second data policy; and the computer substituting the annotated code segment with the compiled alternate code segment.