1. MVC 디자인 패턴 적용
2. 싱글턴(Singleton) 적용
- BoardService
public class BoardService {
private static BoardService boardService = new BoardService();
public static BoardService getInstance() {
return boardService;
}
private BoardDao boardDao = BoardDao.getInstacne();
private BoardService() {}
// 이하 생략
}
- BoardDao
public class BoardDao {
private static BoardDao boardDao = new BoardDao();
public static BoardDao getInstacne() {
return boardDao;
}
private BoardDao() {}
// 이하 생략
}