An optimization framework for “build-or-buy” decisions in software architecture