OCP 1 썸네일형 리스트형 SOLID - OOP design principle[2] - OCP In object-oriented programming, the open–closed principle OCP states "software entities classes,modules,functions,etc. should be open for extension, but closed for modification" println"한식을만들어요." JAPAN -> println"일식을만들어요." else -> throw Exception"그셰프님은없어요." } } } fun main { val chefList = listOfChef(Chef.KOREA, ChefChef.JAPAN ) chefList.forEach { chef -> chef.cook } } 위.. 이전 1 다음