Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
class Human {
constructor(name, age) {
this.name = name;
this.age = age;
}
}
class Profile extends React.Component {
render() {
const yujin = new Human('yujin', 24);
return (
<div>
<h1>{ yujin.name }</h1>
<h2>{ `${yujin.age} ` }</h2>
<h3>{ yujin.githubUrl }</h3>
</div>
)
}
}
class Human {
constructor(name, age) {
this.name = name;
this.age = age;
}
}
class Profile extends React.Component {
render() {
const yujin = new Human('yujin', 24);
return (
<div>
<h1>{ yujin.name }</h1>
<h2>{ `${yujin.age} ` }</h2>
<h3>{ yujin.githubUrl }</h3>
</div>
)
}
}
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
class User implements Entity {
id: number;
name: string;
type: User.Type;
constructor(
id: number,
name: string,
type: User.Type
) {
this.id = id;
this.name = name;
this.type = type;
}
}
Repository
- Entity를 제공하기 위한 Interface
- 실제 구현은 DataSource에 의존성을 가지는 Data Layer에서 이루어짐
interface UserRepositoryType extends RepositoryType {
search(query: string): Observable<List<User>>
}
class SearchUsers extends UseCase<List<User>> {
private repository: UserRepositoryType;
query: string;
constructor(repository: UserRepositoryType) {
super();
this.repository = repository;
}
protected build(): Observable<List<User>> {
return this.repository.search(this.query);
}
protected validate(): boolean {
return !!this.query;
}
}
UseCase
- 도메인 영역의 End-Point
- 실제로 서비스를 이용하는 사용자가 하는 행동을 정의
- repository의 interface 기능을 조합하여 원하는 결과값을 하나로
돌려준다
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
interface UserRepositoryType extends RepositoryType {
search(query: string): Observable<List<User>>
}
class UserRepository implements UserRepositoryType {
private githubApi: GithubApiProvider;
constructor(githubApi: GithubApiProvider) {
this.githubApi = githubApi;
}
search(query: string): Observable<List<User>> {
return this.githubApi.searchUser(query);
}
}
Why Typescript with Clean Architecture
interface ApiProviderDependencies {
github: GithubApiProvider;
}
interface RepositoryDependencies {
user: UserRepository;
}
interface UseCaseDependencies {
searchUsers: SearchUsers;
}
class Context {
private githubAxiosInstance: AxiosInstance;
private apiProviders: ApiProviderDependencies;
private repositories: RepositoryDependencies;
useCases: UseCaseDependencies;
constructor(githubAxiosInstance: AxiosInstance) {
this.githubAxiosInstance = githubAxiosInstance;
this.apiProviders = {
github: new GithubApiProvider(githubAxiosInstance)
};
this.repositories = {
user: new UserRepository(this.apiProviders.github)
};
this.useCases = {
searchUsers: new SearchUsers(this.repositories.user)
}
}
}
const axiosInstance = Axios.create({
baseURL: Config.hosts.github,
timeout: Config.timeout,
headers: {
'Accept': 'application/json'
}
});
export const Application = new Context(axiosInstance);
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
private renderUsers = (users: List<User>) =>
<ul>
{
users.map((user, i) =>
<li key={ `users-${i}` }>
{ user.name }
</li>
)
}
</ul>;
apply(Application.useCases.searchUsers, it => it.query = query)
.runOnAnimateFrame()
.subscribe(
users =>
this.setState({
users,
fetchState: FetchState.FETCHED
}),
error =>
this.setState({
fetchState: FetchState.ERROR
})
)
.unsubscribeBy(this.subscriptionBag)
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
interface Event {
id: string;
name: string;
}
class CardCompanyEvent implements Event {
id: string;
name: string;
}
class StockFirmEvent implements Event {
id: string;
name: string;
}
interface Event {
id: string;
name: string;
}
class CardCompanyEvent implements Event {
id: string;
name: string;
}
class StockFirmEvent implements Event {
id: string;
name: string;
}
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture
Why Typescript with Clean Architecture

More Related Content

PPTX
Les Streams de Java 8
PDF
Formation JPA Avancé / Hibernate gratuite par Ippon 2014
PDF
Hibernate complete notes_by_sekhar_sir_javabynatara_j
PDF
Interface fonctionnelle, Lambda expression, méthode par défaut, référence de...
PDF
Chap 6 : classes et interfaces
PDF
L'API Collector dans tous ses états
PDF
Calculatrice scientifique en JAVA(AWT)
PPT
Création et Gestion de Tables | SQL Oracle
Les Streams de Java 8
Formation JPA Avancé / Hibernate gratuite par Ippon 2014
Hibernate complete notes_by_sekhar_sir_javabynatara_j
Interface fonctionnelle, Lambda expression, méthode par défaut, référence de...
Chap 6 : classes et interfaces
L'API Collector dans tous ses états
Calculatrice scientifique en JAVA(AWT)
Création et Gestion de Tables | SQL Oracle

What's hot (20)

PDF
Spring Framework - Spring Security
PPTX
Belajar Dasar-Dasar GIT
PPTX
Maven tutorial
PPT
PDF
Alphorm.com Formation Vue JS 3 : Exploiter la Composition API
PPTX
오픈소스 개발을 위한 Git 사용법 실습
PPTX
C++20 features
PDF
JVM Mechanics: Understanding the JIT's Tricks
PDF
Python master class part 1
PDF
Functional Domain Modeling - The ZIO 2 Way
PPTX
Wso2 is integration with .net core
PPTX
Spring andspringboot training
PPTX
cours javascript.pptx
PDF
Djangoアプリのデプロイに関するプラクティス / Deploy django application
PDF
炎炎夏日學 Android 課程 - Part1: Kotlin 語法介紹
PDF
Clean code
PPTX
Building with Gradle
PDF
Formation Gratuite Total Tests par les experts Java Ippon
PPT
Object Oriented Programming with Java
PPTX
introduction à MongoDB
Spring Framework - Spring Security
Belajar Dasar-Dasar GIT
Maven tutorial
Alphorm.com Formation Vue JS 3 : Exploiter la Composition API
오픈소스 개발을 위한 Git 사용법 실습
C++20 features
JVM Mechanics: Understanding the JIT's Tricks
Python master class part 1
Functional Domain Modeling - The ZIO 2 Way
Wso2 is integration with .net core
Spring andspringboot training
cours javascript.pptx
Djangoアプリのデプロイに関するプラクティス / Deploy django application
炎炎夏日學 Android 課程 - Part1: Kotlin 語法介紹
Clean code
Building with Gradle
Formation Gratuite Total Tests par les experts Java Ippon
Object Oriented Programming with Java
introduction à MongoDB
Ad

Similar to Why Typescript with Clean Architecture (8)

PDF
GraphQL이란?
PDF
React, Redux and es6/7
PPTX
Pro typescript.ch03.Object Orientation in TypeScript
PPTX
RESTful API 제대로 만들기
PDF
Letswift19-clean-architecture
PDF
API Design Principles Essential 
PDF
Apache Thrift
PDF
JPA Week3 Entity Mapping / Hexagonal Architecture
GraphQL이란?
React, Redux and es6/7
Pro typescript.ch03.Object Orientation in TypeScript
RESTful API 제대로 만들기
Letswift19-clean-architecture
API Design Principles Essential 
Apache Thrift
JPA Week3 Entity Mapping / Hexagonal Architecture
Ad

Recently uploaded (20)

PPTX
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
PDF
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
PDF
Present and Future of Systems Engineering: Air Combat Systems
PPT
Chapter 1 - Introduction to Manufacturing Technology_2.ppt
PDF
Introduction to Power System StabilityPS
PDF
Beginners-Guide-to-Artificial-Intelligence.pdf
PDF
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
PPTX
Principal presentation for NAAC (1).pptx
PPTX
wireless networks, mobile computing.pptx
PPTX
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
PPTX
"Array and Linked List in Data Structures with Types, Operations, Implementat...
PDF
Applications of Equal_Area_Criterion.pdf
PPTX
mechattonicsand iotwith sensor and actuator
PDF
Computer organization and architecuture Digital Notes....pdf
PPTX
Management Information system : MIS-e-Business Systems.pptx
PDF
distributed database system" (DDBS) is often used to refer to both the distri...
PDF
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
PPTX
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
PPTX
ai_satellite_crop_management_20250815030350.pptx
PPTX
A Brief Introduction to IoT- Smart Objects: The "Things" in IoT
CN_Unite_1 AI&DS ENGGERING SPPU PUNE UNIVERSITY
Influence of Green Infrastructure on Residents’ Endorsement of the New Ecolog...
Present and Future of Systems Engineering: Air Combat Systems
Chapter 1 - Introduction to Manufacturing Technology_2.ppt
Introduction to Power System StabilityPS
Beginners-Guide-to-Artificial-Intelligence.pdf
Accra-Kumasi Expressway - Prefeasibility Report Volume 1 of 7.11.2018.pdf
Principal presentation for NAAC (1).pptx
wireless networks, mobile computing.pptx
Graph Data Structures with Types, Traversals, Connectivity, and Real-Life App...
"Array and Linked List in Data Structures with Types, Operations, Implementat...
Applications of Equal_Area_Criterion.pdf
mechattonicsand iotwith sensor and actuator
Computer organization and architecuture Digital Notes....pdf
Management Information system : MIS-e-Business Systems.pptx
distributed database system" (DDBS) is often used to refer to both the distri...
UEFA_Embodied_Carbon_Emissions_Football_Infrastructure.pdf
tack Data Structure with Array and Linked List Implementation, Push and Pop O...
ai_satellite_crop_management_20250815030350.pptx
A Brief Introduction to IoT- Smart Objects: The "Things" in IoT

Why Typescript with Clean Architecture

  • 28. class Human { constructor(name, age) { this.name = name; this.age = age; } } class Profile extends React.Component { render() { const yujin = new Human('yujin', 24); return ( <div> <h1>{ yujin.name }</h1> <h2>{ `${yujin.age} ` }</h2> <h3>{ yujin.githubUrl }</h3> </div> ) } }
  • 29. class Human { constructor(name, age) { this.name = name; this.age = age; } } class Profile extends React.Component { render() { const yujin = new Human('yujin', 24); return ( <div> <h1>{ yujin.name }</h1> <h2>{ `${yujin.age} ` }</h2> <h3>{ yujin.githubUrl }</h3> </div> ) } }
  • 61. class User implements Entity { id: number; name: string; type: User.Type; constructor( id: number, name: string, type: User.Type ) { this.id = id; this.name = name; this.type = type; } }
  • 62. Repository - Entity를 제공하기 위한 Interface - 실제 구현은 DataSource에 의존성을 가지는 Data Layer에서 이루어짐 interface UserRepositoryType extends RepositoryType { search(query: string): Observable<List<User>> }
  • 63. class SearchUsers extends UseCase<List<User>> { private repository: UserRepositoryType; query: string; constructor(repository: UserRepositoryType) { super(); this.repository = repository; } protected build(): Observable<List<User>> { return this.repository.search(this.query); } protected validate(): boolean { return !!this.query; } } UseCase - 도메인 영역의 End-Point - 실제로 서비스를 이용하는 사용자가 하는 행동을 정의 - repository의 interface 기능을 조합하여 원하는 결과값을 하나로 돌려준다
  • 69. interface UserRepositoryType extends RepositoryType { search(query: string): Observable<List<User>> } class UserRepository implements UserRepositoryType { private githubApi: GithubApiProvider; constructor(githubApi: GithubApiProvider) { this.githubApi = githubApi; } search(query: string): Observable<List<User>> { return this.githubApi.searchUser(query); } }
  • 71. interface ApiProviderDependencies { github: GithubApiProvider; } interface RepositoryDependencies { user: UserRepository; } interface UseCaseDependencies { searchUsers: SearchUsers; } class Context { private githubAxiosInstance: AxiosInstance; private apiProviders: ApiProviderDependencies; private repositories: RepositoryDependencies; useCases: UseCaseDependencies; constructor(githubAxiosInstance: AxiosInstance) { this.githubAxiosInstance = githubAxiosInstance; this.apiProviders = { github: new GithubApiProvider(githubAxiosInstance) }; this.repositories = { user: new UserRepository(this.apiProviders.github) }; this.useCases = { searchUsers: new SearchUsers(this.repositories.user) } } } const axiosInstance = Axios.create({ baseURL: Config.hosts.github, timeout: Config.timeout, headers: { 'Accept': 'application/json' } }); export const Application = new Context(axiosInstance);
  • 74. private renderUsers = (users: List<User>) => <ul> { users.map((user, i) => <li key={ `users-${i}` }> { user.name } </li> ) } </ul>; apply(Application.useCases.searchUsers, it => it.query = query) .runOnAnimateFrame() .subscribe( users => this.setState({ users, fetchState: FetchState.FETCHED }), error => this.setState({ fetchState: FetchState.ERROR }) ) .unsubscribeBy(this.subscriptionBag)
  • 80. interface Event { id: string; name: string; } class CardCompanyEvent implements Event { id: string; name: string; } class StockFirmEvent implements Event { id: string; name: string; }
  • 81. interface Event { id: string; name: string; } class CardCompanyEvent implements Event { id: string; name: string; } class StockFirmEvent implements Event { id: string; name: string; }