Building Application Frameworks: Object-Oriented Foundations of Framework Design