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λ₯Ό ν¬ν¨νλ€! νλ μμν¬ μμ μ¬μ©μκ° μ½λλ₯Ό μ
λ ₯νλ€κ° νμν λ λΌμ΄λΈλ¬λ¦¬λ₯Ό νΈμΆ!