Code snippets related to design patterns