design pattern's code