πŸ’»λ‹€ν˜•μ„±μ΄λž€?(JAVA)πŸ§‘πŸ»β€πŸ’»

DEVJUNΒ·2021λ…„ 12μ›” 13일
0
post-custom-banner

1. λ‹€ν˜•μ„±μ΄λž€?

λ‹€ν˜•μ„±μ΄λž€ ν”„λ‘œκ·Έλž¨ μ–Έμ–΄ 각 μš”μ†Œλ“€(μƒμˆ˜, λ³€μˆ˜, 식, 객체, λ©”μ†Œλ“œ λ“±)이 λ‹€μ–‘ν•œ μžλ£Œν˜•(type)에 μ†ν•˜λŠ” 것이 ν—ˆκ°€λ˜λŠ” μ„±μ§ˆμ„ 가리킨닀.
- μœ„ν‚€ν”Όλ””μ•„ 쀑 -


λ‹€ν˜•μ„±μ΄λž€ μ—­ν• κ³Ό κ΅¬ν˜„μœΌλ‘œ 세상을 κ΅¬λΆ„ν•˜λŠ” 것이닀. μ—­ν• κ³Ό κ΅¬ν˜„μœΌλ‘œ κ΅¬λΆ„ν•˜λ©΄ λ‹¨μˆœν•΄μ§€κ³  μœ μ—°ν•΄μ§€κ³  변경도 νŽΈλ¦¬ν•΄μ§„λ‹€. 밑에 사진을 보자!

μ—¬κΈ°μ„œ μš΄μ „μžλ₯Ό ν΄λΌμ΄μ–ΈνŠΈλΌκ³  ν•˜μžκ³  μžλ™μ°¨λ₯Ό μΈν„°νŽ˜μ΄μŠ€λΌκ³  ν•˜μž!
μš΄μ „μž(client)λŠ” μžλ™μž(interface)의 λ‚΄λΆ€κ΅¬μ‘°λŠ” μ•Œ ν•„μš”κ°€ μ—†κ³  λŒ€μƒμ˜ μ—­ν• λ§Œ μ•Œλ©΄ λœλ‹€. λ”°λΌμ„œ μš΄μ „μžλŠ” μžλ™μ°¨μ˜ 내뢀ꡬ쑰가 λ³€κ²½λ˜λ”λΌλ„ 영ν–₯을 받지 μ•Šκ³ , k3λ₯Ό 타닀가 ν…ŒμŠ¬λΌ λͺ¨λΈ3으둜 μžλ™μ°¨ μžμ²΄κ°€ λ³€κ²½λ˜λ”λΌλ„ μ–΄λ– ν•œ 영ν–₯을 받지 μ•ŠλŠ”λ‹€.

μžλ°”μ—μ„œμ˜ λ‹€ν˜•μ„±

μ—­ν• : μΈν„°νŽ˜μ΄μŠ€
κ΅¬ν˜„: μΈν„°νŽ˜μ΄μŠ€λ₯Ό κ΅¬ν˜„ν•œ 클래슀, κ΅¬ν˜„ 객체

public class MemberService {
	private MemberRepository memberRepository = new  MemoryMemberRepository();
}
public class MemberService {
  //private MemberRepository memberRepository = new  MemoryMemberRepository();
    private MemberRepository memberRepository = new  JdbcMemberRepository();
}

μœ„μ—μ„œ MemberRepositoryλΌλŠ” μΈν„°νŽ˜μ΄μŠ€κ°€ 있고 이λ₯Ό ꡬ체화 ν•˜μ—¬ MemoryMemberRepository, Jdbc MemberRepositroy ν΄λž˜μŠ€κ°€ λ§Œλ“€μ–΄μ‘Œλ‹€. ν΄λΌμ΄μ–ΈνŠΈμΈ MemberService ν΄λž˜μŠ€μ—μ„œλŠ” κ²½μš°μ— 따라 μ˜€λ²„λΌμ΄λ”© 된 λ©”μ„œλ“œλ₯Ό μ‹€ν–‰ν•  수 μžˆλ‹€.


πŸ“μ •λ¦¬ν•˜μžλ©΄ λ‹€ν˜•μ„±μ˜ λ³Έμ§ˆμ€ ν΄λΌμ΄μ–ΈνŠΈλ₯Ό λ³€κ²½ν•˜μ§€ μ•Šκ³ , μ„œλ²„μ˜ κ΅¬ν˜„ κΈ°λŠ₯을 μœ μ—°ν•˜κ²Œ λ³€κ²½ν•  수 μžˆλŠ” 것이닀❗️

좜처

https://www.inflearn.com/course/%EC%8A%A4%ED%94%84%EB%A7%81-%ED%95%B5%EC%8B%AC-%EC%9B%90%EB%A6%AC-%EA%B8%B0%EB%B3%B8%ED%8E%B8/dashboard

profile
πŸ§‘πŸ»β€πŸ’»iOS
post-custom-banner

0개의 λŒ“κΈ€