commit design pattern