KIC
-
day63 - Spring Framework(스프링, AOP)KIC/Spring 2021. 9. 13. 22:23
[AOP] - Aspect Oriented Programming. 관점 지향 프로그래밍으로 어플리케이션에서 전반적으로 사용되는 공통 기능들을 공통 관심 사항으로 구분한다. - 중복 코드를 제거하고 그로 인한 간경성과 생산성을 얻을 수 있다. - 재사용성과 유지보수성 또한 증가한다. - Advice 언제 공통 관심 기능을 핵심 로직에 적용할 것인 지를 정의한다. - Jointpoint Advice 가 적용 가능한 지점을 의미한다. 메소드 호출, 필드값 변경 등이 이에 해당한다. - Pointcut Joinpoint의 부분 집합으로써 실제로 Advice가 적용 되는 Jointpoint를 말한다. 정규 표현식이나 Aspectj의 문법을 사용하여 Pointcout을 정의할 수 있다. - Aspect - 여러 객..
-
day62 - Spring Framework(스프링, Annotation)KIC/Spring 2021. 9. 10. 23:19
[Main3_xml.java] package ch02_mainDI; import org.springframework.context.support.GenericXmlApplicationContext; import di03.AuthException; import di03.AuthenticationService; import di03.PasswordChangeService; import di03.UserNotFoundException; public class Main3_xml { public static void main(String[] args) { GenericXmlApplicationContext ctx = new GenericXmlApplicationContext("classpath:ch02_DIXML..
-
day61 - Spring Framework(스프링, DI)KIC/Spring 2021. 9. 10. 00:11
[Container3.xml] [user.java] package di03; public class User { private String id; private String password; public User(String id, String password) { super(); this.id = id; this.password = password; } public String getId() { return id; } public void setId(String id) { this.id = id; } public String getPassword() { return password; } public void setPassword(String password) { this.password = passwo..
-
day60 - Spring Framework(스프링, DI 시작)KIC/Spring 2021. 9. 8. 21:46
[Spring] - 자바 플랫폼을 위한 오픈 소스 애플리케이션이다. - 스프링 프레임워크는 IOC 기반의 프레임워크로 IOC는 Inversion of Control의 약자이다. 말그대로 역전 제어로 제어의 역전 통해서 모듈간의 결합도를 낮춰 효율적으로 개발할 수 있도록 돕는 프레임워크이다. - 의존성 주입(Dependency Injection) 을 통한 유연한 프레임 워크를 구현할 수 있다. - 관점 지향 프로그래밍(AOP: Aspect Orineted Programming) 을 지원한다. - 반복적인 코드를 제거하는데 효과적어서 효율성이 증대된다. [.jar] - jar 파일은 클래스 파일을 모아둔 것이다. - 자신의 소스코드 대신 jar 파일만 줘서 다른 사람들에게 내 코드를 제공하지 않으면서 기능을..
-
day59 - MyBatis(게시판 mybatis 적용)KIC/MyBatis 2021. 9. 7. 22:30
[board.xml] select multiboardseq.nextval from dual insert into multiboard (num, name, pass, subject, content, file1, regdate, readcnt, ref,reflevel, refstep, boardid) values (#{num}, #{name}, #{pass},#{subject},#{content}, #{file1}, sysdate, 0,#{ref}, #{reflevel},#{refstep},#{boardid}) select count(*) count from multiboard where boardid=#{boardid} select * from (select rownum rnum,a.* from (sele..
-
day58 - MyBatis(parameterType, resultType, 게시판에 mybatis 적용)KIC/MyBatis 2021. 9. 6. 23:46
[board.xml] select multiboardseq.nextval from dual insert into multiboard (num, name, pass, subject, content, file1, regdate, readcnt, ref,reflevel, refstep, boardid) values (# {num}, #{name}, #{pass},#{subject},#{content}, #{file1}, sysdate, 0,#{ref}, #{reflevel},#{refstep},#{boardid}) select count(*) count from multiboard where boardid=#{boardid} select * from (select rownum rnum,a.* from (sel..
-
day57 - MyBatis(parameterType, resultType)KIC/MyBatis 2021. 9. 3. 12:19
[parameterType] - 마이바티스에서 parameterType 속성을 사용해서 해당 파라미터의 자료형을 명시해준다. 위에서는 student 객체에 결과가 담긴다. student는 미리 생성해둔 Model 객체이다. [resultType] - select 된 데이터를 반환할 그릇을 의미한다고 한다. -> 즉 parameterType으로 col 과 value가 Map 자료형임을 명시하고 -> resultType으로 결과 값이 student 객체에 담길 것이라는 의미 [#{}] - #{} 사용시 PreparedStatement 생성되고 PreparedStatement 매개 변수 값 안전하게 설정한다. - PreparedStatement 가 제공하는 set 계열의 메소드를 사용하여 (?)를 대체할 값을..
-
day56 - MyBatis(Mybatis, Mybatis 실행 절차)KIC/MyBatis 2021. 9. 3. 02:19
[MyBatis] - 자바에서 데이터베이스 프로그래밍을 좀 더 쉽게 할 수 있게 도와 주는 개발 프레임 워크이다. - java beans 객체를 preparedStatement parameters와 ResultMaps로 쉽게 매핑을 할수 있도록 도와준다. - 이를 통해 database에 접근하기 위한 자바 코드의 양을 줄일 수 있다. [MyBatis 실행 절차] 1. 객체를 파라미터로 전달 -> javaBeans, Map or primitive Wrapper 2. 매핑되는 sql 문장을 수행 -> sql Maps 프레임워크는 PreparedStatement 인스턴스 생성 -> 객체로부터 제공되는 값들을 파라미터로 세팅 3. SQL 문장을 수행하고 ResultSet으로부터 결과 객체를 생성. -> Upda..