Formalizing Patterns and Pattern Languages: A Case Study Approach