Post

Framework πŸ†š Library

Framework VS Library

β˜‘οΈ Framework

클래슀 + μΈν„°νŽ˜μ΄μŠ€μ˜ 집합

framework is already fixed how to use
μ• ν”Œλ¦¬μΌ€μ΄μ…˜ μ½”λ“œκ°€ ν”„λ ˆμž„μ›Œν¬μ— μ˜ν•΄ μ‚¬μš©, κ²°μ •λœλ‹€.
ν”„λ ˆμž„μ›Œν¬μ— 따라 μ‚¬μš©μžκ°€ κ·Έ μ•ˆμ— ν•„μš”ν•œ μ½”λ“œ μž‘μ„±

  • μ•±/μ„œλ²„ ꡬ동
  • λ©”λͺ¨λ¦¬ 관리
  • 이벀트 루프
  • μ†Œν”„νŠΈμ›¨μ–΄μ˜ 섀계, κ΅¬ν˜„μ„ μž¬κ΅¬μ„±μ΄ κ°€λŠ₯ν•˜κ²Œ ν•˜λŠ” μΈν„°νŽ˜μ΄μŠ€

πŸ’‘ Example of Framework

  • Spring for JAVA
  • Django for Python
  • Android for android app

β˜‘οΈ Library

λΌμ΄λΈŒλŸ¬λ¦¬λŠ” κ°œλ°œμ— ν•„μš”ν•œ 것듀을 미리 κ΅¬ν˜„ν•΄ 놓은 도ꡬ이닀.
μž¬μ‚¬μš©μ΄ κ°€λŠ₯ν•˜λ„λ‘ κΈ°λŠ₯을 미리 κ΅¬ν˜„ν•΄λ†“κ³  ν•„μš”ν•œ κ³³μ—μ„œ ν˜ΈμΆœν•΄ μ‚¬μš©ν•œλ‹€.

ν”„λ ˆμž„μ›Œν¬μ™€λŠ” λ‹€λ₯΄κ²Œ, μ‚¬μš©μžκ°€ 라이브러리λ₯Ό μ‚¬μš©ν•΄ μ• ν”Œλ¦¬μΌ€μ΄μ…˜ 흐름을 직접 μ œμ–΄

  • 미리 μž‘μ„±λœ μ½”λ“œ
  • ν•¨μˆ˜
  • 클래슀 λ“±

πŸ’‘ Example of Library

  • Python pip둜 μ„€μΉ˜ν•œ νŒ¨ν‚€μ§€/λͺ¨λ“ˆ (tensorflow, pandas, beautifulsoup λ“±λ“±)
  • C++의 ν‘œμ€€ ν…œν”Œλ¦Ώ 라이브러리 (STL)
  • Node.jsμ—μ„œ npm으둜 μ„€μΉ˜ν•œ λͺ¨λ“ˆ
  • HTML의 ν΄λΌμ΄μ–ΈνŠΈ μ‚¬μ΄λ“œ μ‘°μž‘μ„ λ‹¨μˆœν™”ν•˜λŠ” JQuery
  • μ›Ήμ—μ„œ μ‚¬μš©μž μΈν„°νŽ˜μ΄μŠ€ κ°œλ°œμ— μ‚¬μš©λ˜λŠ” React.js

β˜‘οΈ IOC μ œμ–΄μ˜ μ—­μ „

Inversion of Control ν”„λ ˆμž„μ›Œν¬μ™€ 라이브러리의 μ°¨μ΄λŠ” μ œμ–΄νλ¦„μ΄ 어디에 μžˆλŠ”κ°€μ΄λ‹€.
Who has the flow of the application?

  • μ–΄λ–€ 일을 ν•˜λ„λ‘ λ§Œλ“€μ–΄μ§„ framework에 μ˜ν•΄ controlκΆŒν•œμ„ μœ„μž„ν•˜λŠ” 것
  • ν”„λ ˆμž„μ›Œν¬μ—κ²Œ μ œμ–΄μ˜ 흐름을 λ„˜κ²¨μ„œ κ°œλ°œμžκ°€ μ½”λ“œλ₯Ό νŽΈν•˜κ²Œ μž‘μ„±

  • When you use a library, you are in charge of the flow of the application. You are choosing when and where to call the library.
  • When you use a framework, the framework is in charge of the flow. It provides some places for you to plug in your code, but it calls the code you plugged in as needed.

frameworkλŠ” libraryλ₯Ό ν¬ν•¨ν•œλ‹€! ν”„λ ˆμž„μ›Œν¬ μœ„μ— μ‚¬μš©μžκ°€ μ½”λ“œλ₯Ό μž…λ ₯ν•˜λ‹€κ°€ ν•„μš”ν•  λ–„ 라이브러리λ₯Ό 호좜!

This post is licensed under CC BY 4.0 by the author.