Framework
Framework
The skeleton of application development. Unlike a library, it determines the control flow.
Framework
The skeleton of application development. Unlike a library, it determines the control flow.
A Framework is a reusable software platform that provides the skeleton and structure for developing software applications. It lets developers build applications on proven design patterns and common functionality, without having to write everything from scratch.
The biggest difference between a framework and a library is 'Inversion of Control (IoC)'. With a library, the developer calls it when needed, but with a framework, the framework calls the code the developer wrote. This is also called the "Hollywood Principle (Don't call us, we'll call you)".
Representative frameworks include Spring (Java), Django (Python), Express (Node.js), and Laravel (PHP) for web backends, and React, Vue, and Angular for the frontend. Flutter and React Native are widely used in mobile development, and PyTorch and TensorFlow in AI/ML.
Frameworks offer advantages such as improved productivity, code consistency, security features, and community support. On the other hand, they also have drawbacks such as a learning curve, limited flexibility, and framework dependency (vendor lock-in), so you must choose a framework that fits the project requirements carefully.
# Flask 프레임워크 사용 예제 (Python)
# 프레임워크가 라우팅, 요청 처리, 응답 생성을 담당
from flask import Flask, jsonify, request
app = Flask(__name__)
# 프레임워크가 이 함수를 호출 (제어의 역전)
@app.route('/api/users', methods=['GET'])
def get_users():
users = [
{'id': 1, 'name': '김개발', 'role': 'Backend'},
{'id': 2, 'name': '이프론트', 'role': 'Frontend'}
]
return jsonify(users)
@app.route('/api/users', methods=['POST'])
def create_user():
data = request.get_json()
# 프레임워크가 자동으로 JSON 파싱, 유효성 검사 등 처리
new_user = {
'id': 3,
'name': data['name'],
'role': data['role']
}
return jsonify(new_user), 201
# 프레임워크가 서버 실행, 요청 라우팅 등 모든 것을 관리
if __name__ == '__main__':
app.run(debug=True, port=5000)
# Express.js 프레임워크 예제 (Node.js) - 비교
# const express = require('express');
# const app = express();
#
# app.get('/api/users', (req, res) => {
# res.json([{ id: 1, name: 'Kim' }]);
# });
#
# app.listen(3000);
"I think we should do this project with the Spring Boot framework. Many on our team have Java experience, and enterprise-level security and scalability come built in. Following the framework conventions also shortens onboarding time."
"The key difference between a framework and a library is inversion of control. With a library, I call it, but with a framework, the framework calls the code I wrote. For example, when you define a component in React, React calls that component's render when state changes."
"You bypassed the Django ORM and wrote raw SQL, but if you use the QuerySet the framework provides, SQL injection defense and DB portability are guaranteed automatically. Following framework conventions is better for long-term maintenance."
Take a mock interview on this topic → WIA SOOM AI Interview · Start for free
If you want to implement things very differently from a framework's conventions, choose a different framework instead. Fighting the framework greatly reduces productivity.
Old framework versions may have security vulnerabilities. Make a plan for regular updates and migrations. When upgrading a major version, check the Breaking Changes carefully.
Read the official documentation thoroughly and follow the project structure and patterns the framework recommends. This makes your code easy for other developers to understand and lets you make the most of the framework's strengths.