Design patterns example codes