You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
Uh oh!
There was an error while loading. Please reload this page.
-
스프링을 왜 사용할까?
웹 서버도 띄워주고 편리해서.. 라는 이유도 있지만 핵심 원리는
객체 지향 프로그래밍에 있다.스프링은 자바 언어 기반의 프레임워크로 자바 언어의 가장 큰 특징인
객체 지향 프로그래밍이 가능하게 해주는 프레임워크객체 지향 프로그래밍
다형성, 상속, 추상화, 캡슐화
프로그램을 명령어의 목록이 아닌 객체의 모임으로 파악하고자 하는 것이다. 프로그램을 유연하고 변경이 용이하게 만들어줌
다형성
스프링과 객체 지향
스프링은 객체 지향 프로그래밍에서 가장 중요한
다형성을 극대화 할 수 있도록 도와준다. 스프링에서 이야기하는제어의 역전(IoC),의존관계 주입(DI)은 다형성을 활용해서 역할과 구현을 편리하게 다룰 수 있도록 지원해준다.SOLID
객체 지향 설계의 5가지 원칙
한계
-> 확장에는 열려있으나 변경에는 닫혀 있어야 한다는
OCP위반-> 구현 클래스에 의존하지 말고 인터페이스에 의존해야 한다는
DIP위반다형성만으로는
OCP와DIP를 지킬 수 없다. 이럴 때 도와주는 게 바로스프링 프레임워크(스프링 컨테이너)DI (Dependency Injection)로OCP와DIP를 가능하게 지원해주어 클라이언트 코드의 변경없이 기능을 확장할 수 있다.Beta Was this translation helpful? Give feedback.
All reactions