function. as a fat, margarine provides baked goods with texture, mouthfeel, and other sensory attributes. its other roles include extending a product's shelf life.