SlideShare une entreprise Scribd logo
1  sur  60
Télécharger pour lire hors ligne
class SuperRobotHand {}
class RobotHand {}
class Robot {
let hand: RobotHand = RobotHand()
}
class SuperRobotHand {}
class RobotHand {}
class Robot {
let hand: RobotHand = RobotHand()
}
protocol RobotHand {}
class NormalRobotHand: RobotHand {}
class SuperRobotHand: RobotHand {}
class Robot {
let hand: RobotHand = NormalRobotHand()
}
protocol RobotHand {}
class NormalRobotHand: RobotHand {}
class SuperRobotHand: RobotHand {}
class Robot {
let hand: RobotHand = NormalRobotHand()
}
protocol RobotHand {}
protocol RobotBody {}
class NormalRobotHand: RobotHand {}
class SuperRobotHand: RobotHand {}
class CoolRobotBody: RobotBody {}
class CuteRobotBody: RobotBody {}
class Robot {
init(hand: RobotHand, body: RobotBody) { ... }
}
class Factory {
func makeRobot() -> Robot {
return Robot(hand: SuperRobotHand(), body: CuteRobotBody())
}
}
class Factory {
func makeRobot() -> Robot {
return Robot(hand: SuperRobotHand(), body: CuteRobotBody())
}
}
class Robot {
/// Property Injection
let hand: RobotHand = NormalRobotHand()
/// Constructor Injection
init(body: RobotBody) {
self.hand = hand
self.body = body
}
}
class SeoulFactory {
let robot = Robot(
hand: SuperRobotHand(),
body: CuteRobotBody()
)
}
class IncheonFactory {
let robot = Robot(
hand: SuperRobotHand(),
body: CuteRobotBody()
)
}
IoC(Inversion of Control)를 구현하는 프레임워크로 객체를 관리하고,
객체의 생성을 책임지고, 의존성을 관리하는 컨테이너이다.
protocol RobotType {}
class Robot: RobotType { ... }
class SeoulFactory {
let robot = Container.get(RobotType.self)
}
class IncheonFactory {
let robot = Container.get(RobotType.self)
}
@UIApplicationMain
class AppDelegate: UIResponder, UIApplicationDelegate {
// weaver: movieManager = MovieManager <- MovieManaging
// weaver: movieManager.scope = .container
}
protocol MovieManaging {}
class MovieManager: MovieManaging {}
DEFINITIONS:
- service: MovieManaging
component: MovieManager
interface MovieManaging {}
@Component
class MovieManager() : MovieManaging {}
protocol MovieManaging {}
class MovieManager: MovieManaging, Component {}
protocol UserService {
func login(id: String, password: String) -> User?
func logout()
}
class UserServiceImpl: UserService, Component {
func login(id: String, password: String) -> User? {
...
}
func logout() {
...
}
init() {}
}
class LoginViewModel: Autowired {
let userService: UserService
required init(_ userService: UserService) {
self.userService = userService
}
}
class LoginViewModel: Autowired {
let userService: UserService
required init(_ userService: UserService) {
self.userService = userService
}
}
UserService
UserServiceImpl
LoginViewModel
IoC Container
class FriendListViewModel: Autowired {
func generateInfo(by id: String) -> FriendInfoViewModel? {
let friend = friendService.getFriend(by: id)
return Inject(
FriendInfoViewModel.self,
with: (
userID: friend.id,
cachedName: friend.name
)
)
}
}
class FriendListViewModel: Autowired {
func generateInfo(by id: String) -> FriendInfoViewModel? {
let friend = friendService.getFriend(by: id)
return Inject(
FriendInfoViewModel.self,
with: (
userID: friend.id,
cachedName: friend.name
)
)
}
}
class FriendPayload: Payload {
required init(
with argument: (userID: String, cachedName: String)
) { ... }
}
class FriendInfoViewModel: AutowiredFactory {
required init(
_ accountService: AccountService,
payload: FriendPayload
) { ... }
}
class FriendPayload: Payload {
required init(
with argument: (userID: String, cachedName: String)
) { ... }
}
class FriendInfoViewModel: AutowiredFactory {
required init(
_ accountService: AccountService,
payload: FriendPayload
) { ... }
}
class FriendPayload: Payload {
required init(
with argument: (userID: String, cachedName: String)
) { ... }
}
class FriendInfoViewModel: AutowiredFactory {
required init(
_ accountService: AccountService,
payload: FriendPayload
) { ... }
}
알아보자 Dependency Injection과 Deli
알아보자 Dependency Injection과 Deli
알아보자 Dependency Injection과 Deli
알아보자 Dependency Injection과 Deli

Contenu connexe

Tendances

Presentation Spring, Spring MVC
Presentation Spring, Spring MVCPresentation Spring, Spring MVC
Presentation Spring, Spring MVCNathaniel Richand
 
Testing Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 worldTesting Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 worldYura Nosenko
 
그래서 테스트 코드는 어떻게 작성하나요?.pdf
그래서 테스트 코드는 어떻게 작성하나요?.pdf그래서 테스트 코드는 어떻게 작성하나요?.pdf
그래서 테스트 코드는 어떻게 작성하나요?.pdftokijh
 
백기선의 스프링 부트
백기선의 스프링 부트백기선의 스프링 부트
백기선의 스프링 부트Keesun Baik
 
画面状態を抽象化してテスタブル設計ライフを送ろう
画面状態を抽象化してテスタブル設計ライフを送ろう画面状態を抽象化してテスタブル設計ライフを送ろう
画面状態を抽象化してテスタブル設計ライフを送ろうHiroshi Kikuchi
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with SpringJoshua Long
 
Windows IOCP vs Linux EPOLL Performance Comparison
Windows IOCP vs Linux EPOLL Performance ComparisonWindows IOCP vs Linux EPOLL Performance Comparison
Windows IOCP vs Linux EPOLL Performance ComparisonSeungmo Koo
 
구름 이야기(Feat. gcp) - 구글클라우드(GCP) 활용 사례
구름 이야기(Feat. gcp) - 구글클라우드(GCP) 활용 사례구름 이야기(Feat. gcp) - 구글클라우드(GCP) 활용 사례
구름 이야기(Feat. gcp) - 구글클라우드(GCP) 활용 사례Seongyun Byeon
 
APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...
APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...
APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...Tchelinux
 
훌륭한 개발자로 성장하기
훌륭한 개발자로 성장하기훌륭한 개발자로 성장하기
훌륭한 개발자로 성장하기Changyol BAEK
 
Modern C++ 프로그래머를 위한 CPP11/14 핵심
Modern C++ 프로그래머를 위한 CPP11/14 핵심Modern C++ 프로그래머를 위한 CPP11/14 핵심
Modern C++ 프로그래머를 위한 CPP11/14 핵심흥배 최
 
REST API 설계
REST API 설계REST API 설계
REST API 설계Terry Cho
 
Python과 Git으로 만드는 모바일 게임 패치 시스템
Python과 Git으로 만드는 모바일 게임 패치 시스템Python과 Git으로 만드는 모바일 게임 패치 시스템
Python과 Git으로 만드는 모바일 게임 패치 시스템Youngtaek Oh
 
KGC 2014: 분산 게임 서버 구조론
KGC 2014: 분산 게임 서버 구조론KGC 2014: 분산 게임 서버 구조론
KGC 2014: 분산 게임 서버 구조론Hyunjik Bae
 
My sql connector.c++ 기본 가이드
My sql connector.c++ 기본 가이드My sql connector.c++ 기본 가이드
My sql connector.c++ 기본 가이드ChungYi1
 
Spring boot
Spring bootSpring boot
Spring bootsdeeg
 
Spring integration을 통해_살펴본_메시징_세계
Spring integration을 통해_살펴본_메시징_세계Spring integration을 통해_살펴본_메시징_세계
Spring integration을 통해_살펴본_메시징_세계Wangeun Lee
 
Introduction à React JS
Introduction à React JSIntroduction à React JS
Introduction à React JSAbdoulaye Dieng
 
오픈소스 프레임워크 기반 웹 서비스 설계 (Example)
오픈소스 프레임워크 기반 웹 서비스 설계 (Example)오픈소스 프레임워크 기반 웹 서비스 설계 (Example)
오픈소스 프레임워크 기반 웹 서비스 설계 (Example)중선 곽
 

Tendances (20)

Presentation Spring, Spring MVC
Presentation Spring, Spring MVCPresentation Spring, Spring MVC
Presentation Spring, Spring MVC
 
Testing Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 worldTesting Spring Boot application in post-JUnit 4 world
Testing Spring Boot application in post-JUnit 4 world
 
그래서 테스트 코드는 어떻게 작성하나요?.pdf
그래서 테스트 코드는 어떻게 작성하나요?.pdf그래서 테스트 코드는 어떻게 작성하나요?.pdf
그래서 테스트 코드는 어떻게 작성하나요?.pdf
 
백기선의 스프링 부트
백기선의 스프링 부트백기선의 스프링 부트
백기선의 스프링 부트
 
画面状態を抽象化してテスタブル設計ライフを送ろう
画面状態を抽象化してテスタブル設計ライフを送ろう画面状態を抽象化してテスタブル設計ライフを送ろう
画面状態を抽象化してテスタブル設計ライフを送ろう
 
REST APIs with Spring
REST APIs with SpringREST APIs with Spring
REST APIs with Spring
 
Windows IOCP vs Linux EPOLL Performance Comparison
Windows IOCP vs Linux EPOLL Performance ComparisonWindows IOCP vs Linux EPOLL Performance Comparison
Windows IOCP vs Linux EPOLL Performance Comparison
 
구름 이야기(Feat. gcp) - 구글클라우드(GCP) 활용 사례
구름 이야기(Feat. gcp) - 구글클라우드(GCP) 활용 사례구름 이야기(Feat. gcp) - 구글클라우드(GCP) 활용 사례
구름 이야기(Feat. gcp) - 구글클라우드(GCP) 활용 사례
 
APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...
APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...
APIs, REST e RESTful: O que os programadores precisam saber? - Marcos Echevar...
 
훌륭한 개발자로 성장하기
훌륭한 개발자로 성장하기훌륭한 개발자로 성장하기
훌륭한 개발자로 성장하기
 
Modern C++ 프로그래머를 위한 CPP11/14 핵심
Modern C++ 프로그래머를 위한 CPP11/14 핵심Modern C++ 프로그래머를 위한 CPP11/14 핵심
Modern C++ 프로그래머를 위한 CPP11/14 핵심
 
REST API 설계
REST API 설계REST API 설계
REST API 설계
 
Python과 Git으로 만드는 모바일 게임 패치 시스템
Python과 Git으로 만드는 모바일 게임 패치 시스템Python과 Git으로 만드는 모바일 게임 패치 시스템
Python과 Git으로 만드는 모바일 게임 패치 시스템
 
KGC 2014: 분산 게임 서버 구조론
KGC 2014: 분산 게임 서버 구조론KGC 2014: 분산 게임 서버 구조론
KGC 2014: 분산 게임 서버 구조론
 
My sql connector.c++ 기본 가이드
My sql connector.c++ 기본 가이드My sql connector.c++ 기본 가이드
My sql connector.c++ 기본 가이드
 
Spring boot
Spring bootSpring boot
Spring boot
 
Spring integration을 통해_살펴본_메시징_세계
Spring integration을 통해_살펴본_메시징_세계Spring integration을 통해_살펴본_메시징_세계
Spring integration을 통해_살펴본_메시징_세계
 
Introduction à React JS
Introduction à React JSIntroduction à React JS
Introduction à React JS
 
Iocp advanced
Iocp advancedIocp advanced
Iocp advanced
 
오픈소스 프레임워크 기반 웹 서비스 설계 (Example)
오픈소스 프레임워크 기반 웹 서비스 설계 (Example)오픈소스 프레임워크 기반 웹 서비스 설계 (Example)
오픈소스 프레임워크 기반 웹 서비스 설계 (Example)
 

Similaire à 알아보자 Dependency Injection과 Deli

The definitive guide to java agents
The definitive guide to java agentsThe definitive guide to java agents
The definitive guide to java agentsRafael Winterhalter
 
Desarrollo para Android con Groovy
Desarrollo para Android con GroovyDesarrollo para Android con Groovy
Desarrollo para Android con GroovySoftware Guru
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummaryAmal Khailtash
 
Protocol-Oriented Programming in Swift
Protocol-Oriented Programming in SwiftProtocol-Oriented Programming in Swift
Protocol-Oriented Programming in SwiftOleksandr Stepanov
 
Intro programacion funcional
Intro programacion funcionalIntro programacion funcional
Intro programacion funcionalNSCoder Mexico
 
Paradigmas de linguagens de programacao - aula#9
Paradigmas de linguagens de programacao - aula#9Paradigmas de linguagens de programacao - aula#9
Paradigmas de linguagens de programacao - aula#9Ismar Silveira
 
Marvel of Annotation Preprocessing in Java by Alexey Buzdin
Marvel of Annotation Preprocessing in Java by Alexey BuzdinMarvel of Annotation Preprocessing in Java by Alexey Buzdin
Marvel of Annotation Preprocessing in Java by Alexey BuzdinJava User Group Latvia
 
Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)
Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)
Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)Ontico
 
"Удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Avito)
"Удобный и расширяемый роутинг в iOS-приложении" Тимур  Юсипов (Avito)"Удобный и расширяемый роутинг в iOS-приложении" Тимур  Юсипов (Avito)
"Удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Avito)AvitoTech
 
What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.Mark Rees
 
Taming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeTaming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeMacoscope
 
Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy codeShriKant Vashishtha
 
"Marshroute: удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Av...
"Marshroute: удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Av..."Marshroute: удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Av...
"Marshroute: удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Av...AvitoTech
 
Code generation for alternative languages
Code generation for alternative languagesCode generation for alternative languages
Code generation for alternative languagesRafael Winterhalter
 
[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM patternNAVER Engineering
 

Similaire à 알아보자 Dependency Injection과 Deli (20)

The definitive guide to java agents
The definitive guide to java agentsThe definitive guide to java agents
The definitive guide to java agents
 
Griffon @ Svwjug
Griffon @ SvwjugGriffon @ Svwjug
Griffon @ Svwjug
 
Java byte code in practice
Java byte code in practiceJava byte code in practice
Java byte code in practice
 
Desarrollo para Android con Groovy
Desarrollo para Android con GroovyDesarrollo para Android con Groovy
Desarrollo para Android con Groovy
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features Summary
 
Protocol-Oriented Programming in Swift
Protocol-Oriented Programming in SwiftProtocol-Oriented Programming in Swift
Protocol-Oriented Programming in Swift
 
Intro programacion funcional
Intro programacion funcionalIntro programacion funcional
Intro programacion funcional
 
Paradigmas de linguagens de programacao - aula#9
Paradigmas de linguagens de programacao - aula#9Paradigmas de linguagens de programacao - aula#9
Paradigmas de linguagens de programacao - aula#9
 
E:\Plp 2009 2\Plp 9
E:\Plp 2009 2\Plp 9E:\Plp 2009 2\Plp 9
E:\Plp 2009 2\Plp 9
 
Marvel of Annotation Preprocessing in Java by Alexey Buzdin
Marvel of Annotation Preprocessing in Java by Alexey BuzdinMarvel of Annotation Preprocessing in Java by Alexey Buzdin
Marvel of Annotation Preprocessing in Java by Alexey Buzdin
 
Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)
Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)
Удобный и расширяемый роутинг в iOS-приложении / Тимур Юсипов (Avito)
 
"Удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Avito)
"Удобный и расширяемый роутинг в iOS-приложении" Тимур  Юсипов (Avito)"Удобный и расширяемый роутинг в iOS-приложении" Тимур  Юсипов (Avito)
"Удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Avito)
 
DotNet Conference: code smells
DotNet Conference: code smellsDotNet Conference: code smells
DotNet Conference: code smells
 
What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.What do you mean it needs to be Java based? How jython saved the day.
What do you mean it needs to be Java based? How jython saved the day.
 
Taming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, MacoscopeTaming Core Data by Arek Holko, Macoscope
Taming Core Data by Arek Holko, Macoscope
 
Working effectively with legacy code
Working effectively with legacy codeWorking effectively with legacy code
Working effectively with legacy code
 
"Marshroute: удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Av...
"Marshroute: удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Av..."Marshroute: удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Av...
"Marshroute: удобный и расширяемый роутинг в iOS-приложении" Тимур Юсипов (Av...
 
Code generation for alternative languages
Code generation for alternative languagesCode generation for alternative languages
Code generation for alternative languages
 
Javascript Design Patterns
Javascript Design PatternsJavascript Design Patterns
Javascript Design Patterns
 
[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern[22]Efficient and Testable MVVM pattern
[22]Efficient and Testable MVVM pattern
 

Dernier

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Alan Dix
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...HostedbyConfluent
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024BookNet Canada
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesSinan KOZAK
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slidespraypatel2
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphNeo4j
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptxHampshireHUG
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptxLBM Solutions
 

Dernier (20)

Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...Swan(sea) Song – personal research during my six years at Swansea ... and bey...
Swan(sea) Song – personal research during my six years at Swansea ... and bey...
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
Transforming Data Streams with Kafka Connect: An Introduction to Single Messa...
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
Transcript: #StandardsGoals for 2024: What’s new for BISAC - Tech Forum 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Unblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen FramesUnblocking The Main Thread Solving ANRs and Frozen Frames
Unblocking The Main Thread Solving ANRs and Frozen Frames
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Slack Application Development 101 Slides
Slack Application Development 101 SlidesSlack Application Development 101 Slides
Slack Application Development 101 Slides
 
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge GraphSIEMENS: RAPUNZEL – A Tale About Knowledge Graph
SIEMENS: RAPUNZEL – A Tale About Knowledge Graph
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Key Features Of Token Development (1).pptx
Key  Features Of Token  Development (1).pptxKey  Features Of Token  Development (1).pptx
Key Features Of Token Development (1).pptx
 

알아보자 Dependency Injection과 Deli

  • 1.
  • 2.
  • 3.
  • 4.
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 17.
  • 18. class SuperRobotHand {} class RobotHand {} class Robot { let hand: RobotHand = RobotHand() }
  • 19. class SuperRobotHand {} class RobotHand {} class Robot { let hand: RobotHand = RobotHand() }
  • 20. protocol RobotHand {} class NormalRobotHand: RobotHand {} class SuperRobotHand: RobotHand {} class Robot { let hand: RobotHand = NormalRobotHand() }
  • 21. protocol RobotHand {} class NormalRobotHand: RobotHand {} class SuperRobotHand: RobotHand {} class Robot { let hand: RobotHand = NormalRobotHand() }
  • 22.
  • 23.
  • 24. protocol RobotHand {} protocol RobotBody {} class NormalRobotHand: RobotHand {} class SuperRobotHand: RobotHand {} class CoolRobotBody: RobotBody {} class CuteRobotBody: RobotBody {} class Robot { init(hand: RobotHand, body: RobotBody) { ... } } class Factory { func makeRobot() -> Robot { return Robot(hand: SuperRobotHand(), body: CuteRobotBody()) } }
  • 25. class Factory { func makeRobot() -> Robot { return Robot(hand: SuperRobotHand(), body: CuteRobotBody()) } }
  • 26. class Robot { /// Property Injection let hand: RobotHand = NormalRobotHand() /// Constructor Injection init(body: RobotBody) { self.hand = hand self.body = body } }
  • 27.
  • 28. class SeoulFactory { let robot = Robot( hand: SuperRobotHand(), body: CuteRobotBody() ) } class IncheonFactory { let robot = Robot( hand: SuperRobotHand(), body: CuteRobotBody() ) }
  • 29.
  • 30. IoC(Inversion of Control)를 구현하는 프레임워크로 객체를 관리하고, 객체의 생성을 책임지고, 의존성을 관리하는 컨테이너이다.
  • 31.
  • 32. protocol RobotType {} class Robot: RobotType { ... } class SeoulFactory { let robot = Container.get(RobotType.self) } class IncheonFactory { let robot = Container.get(RobotType.self) }
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38.
  • 39.
  • 40. @UIApplicationMain class AppDelegate: UIResponder, UIApplicationDelegate { // weaver: movieManager = MovieManager <- MovieManaging // weaver: movieManager.scope = .container } protocol MovieManaging {} class MovieManager: MovieManaging {}
  • 42. interface MovieManaging {} @Component class MovieManager() : MovieManaging {}
  • 43. protocol MovieManaging {} class MovieManager: MovieManaging, Component {}
  • 44.
  • 45.
  • 46. protocol UserService { func login(id: String, password: String) -> User? func logout() } class UserServiceImpl: UserService, Component { func login(id: String, password: String) -> User? { ... } func logout() { ... } init() {} }
  • 47.
  • 48. class LoginViewModel: Autowired { let userService: UserService required init(_ userService: UserService) { self.userService = userService } }
  • 49. class LoginViewModel: Autowired { let userService: UserService required init(_ userService: UserService) { self.userService = userService } }
  • 51.
  • 52. class FriendListViewModel: Autowired { func generateInfo(by id: String) -> FriendInfoViewModel? { let friend = friendService.getFriend(by: id) return Inject( FriendInfoViewModel.self, with: ( userID: friend.id, cachedName: friend.name ) ) } }
  • 53. class FriendListViewModel: Autowired { func generateInfo(by id: String) -> FriendInfoViewModel? { let friend = friendService.getFriend(by: id) return Inject( FriendInfoViewModel.self, with: ( userID: friend.id, cachedName: friend.name ) ) } }
  • 54. class FriendPayload: Payload { required init( with argument: (userID: String, cachedName: String) ) { ... } } class FriendInfoViewModel: AutowiredFactory { required init( _ accountService: AccountService, payload: FriendPayload ) { ... } }
  • 55. class FriendPayload: Payload { required init( with argument: (userID: String, cachedName: String) ) { ... } } class FriendInfoViewModel: AutowiredFactory { required init( _ accountService: AccountService, payload: FriendPayload ) { ... } }
  • 56. class FriendPayload: Payload { required init( with argument: (userID: String, cachedName: String) ) { ... } } class FriendInfoViewModel: AutowiredFactory { required init( _ accountService: AccountService, payload: FriendPayload ) { ... } }