It was written and produced by the husband-and-wife team of Nancy Meyers and Charles Shyer (who also directed the film).