See DependencyInversionPrinciple. See also DependencyInversionAndXp.