Singleton

Singleton? 왜 디자인 패턴을 쓰는지는 링크를 참조해주세요! - Singleton(싱글톤) 패턴 : Application에서 Instance를 하나만 만들어 사용하기 위한 패턴이다. - 외부에서 객체를 생성하는 것을 막기 위한 패턴 - Use Case는 DB에 연결할 때, jdbc 라이브러리를 통해서 연결하는데 중복 Connection은 피하기 위해서 사용 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 package pattern; public class Singleton { private static Singleton instance; private Singleton() { } public static Singleton getInstance() { if (instance ..
huisam
'Singleton' 태그의 글 목록