백엔드 코드 설계란? 눈에 보이지 않는 설계라 그리기 어려움. 각자의 위치와 순서, 클래스 배치에 따라 기능이 달라질 수 있어서 전체적인 그림을 볼 줄 아는 것이 중요하다.
제네릭이란? 우리가 변수를 선언할때 변수 타입을 지정해주듯이, 제네릭은 객체(Object)에 타입을 지정해주는 것이라고 보면 된다.
class Customer3 extends Thread{
}
public class List2 {
/*선언부*/
List<Customer3> list = new Vector<>();
/*정의메소드*/
public void methodA() {
list.add(this);
}
/*메인메소드*/
public static void main(String[] args) {
List2 l2 = new List2();
l2.methodA();
}
}
class Customer3 extends Thread{
}
public class List2 {
/*선언부*/
List<Customer3> list = new Vector<>();
/*정의메소드*/
public void methodA() {
Customer3 cs = new Customer3();
list.add(cs);
}
/*메인메소드*/
public static void main(String[] args) {
List2 l2 = new List2();
l2.methodA();
}
}
아래 두 코드의 생성은 모두 가능하다 상위인 Thread를 선언부에 두는 것을 더 지향함
(다형성을 이해하고 있다는 것)
ChatClientThread tct = new ChatClientThread(this);
Thread tct = new ChatClientThread(this);
아래에서 book1은 인덱스 이름임.
create table book1(
b_no number(5) constraints book1_pk primary key,
b_title varchar2(30) not null,
b_author varchar2(30) not null,
b_price number(7) default 0
);
Map은 한 개의 Row만 or 한 개의 컬럼 담을 수 있음.
( MyBatis(SQL) 오픈소스 - 생산성 높음, 코딩양 30% 감소)
오라클을 통해 table의 틀 저장 가능
create table book1(
b_no number(5) constraints book1_pk primary key,
b_title varchar2(30) not null,
b_author varchar2(30) not null,
b_price number(7) default 0
);
insert into book1(b_no,b_title,b_author,b_price)
values(1, '자바의정석','남궁성',30000);
insert into book1(b_no,b_title,b_author,b_price)
values(2, '오라클','나신입',20000);
insert into book1(b_no,b_title,b_author,b_price)
values(3, 'html5','나초보',50000);
select b_no, b_title, b_author, b_price from book1
commit;