design patter of gang of four implement in ooerlang and java