본 강의는 자바 스프링 완전 정복 시리즈의 8번째 강의입니다. 우아한형제들 최연소 기술이사 김영한의 스프링 완전 정복 로드맵을 먼저 확인해주세요. (바로가기)
스프링 핵심 원리 - 기본편
객체 지향 설계와 스프링
SOLID - SRP, OCP, DIP
스프링 컨테이너와 스프링 빈
스프링 컨테이너 - IoC, DI
의존관계 주입
빈 생성주기와 스코프
스프링 핵심 원리 - 고급편 현재 강의
스프링 핵심 디자인 패턴
템플릿 메서드 패턴, 전략 패턴, 템플릿 콜백 패턴, 프록시 패턴, 데코레이터 패턴
쓰레드 로컬
동시성 문제, 멀티쓰레드, 쓰레드 로컬
스프링 AOP
개념, 동작 원리, 실전 예제, 주의 사항
김영한의 스프링 핵심 원리 고급편 핵심 디자인 패턴, 쓰레드 로컬, 스프링 AOP
실무에서 가장 많이 사용하는 기술 스프링 프레임워크
실력 있는 개발자가 되려면 실무에서 자주 사용하는 도구를 깊이 있게 이해해야 합니다. 스프링은 실무에서 가장 많이 사용하는 백엔드 기술입니다. 따라서 백엔드 개발자라면 스프링을 깊이 있게 이해하는 것이 중요합니다.
스프링 핵심 원리 기본에서 고급으로
우리는 앞서 스프링 핵심 원리 - 기본편에서 스프링과 객체 지향 개발의 기본기를 학습했습니다. 스프링을 깊이 있게 이해하고, 실무에서 실력 있는 개발자가 되려면, 기본편에서 학습한 내용을 기반으로 크게 3가지 핵심 고급 개념을 알아야 합니다. 이번 스프링 핵심 원리 - 고급편에서는 이러한 고급 개념을 학습합니다.
1. 스프링 핵심 디자인 패턴 2. 동시성 문제를 다루기 위한 쓰레드 로컬 3. 스프링 AOP
스프링 핵심 원리 고급편
1. 스프링 핵심 디자인 패턴
스프링의 내부 기술들은 몇 가지 핵심 디자인 패턴으로 만들어져 있습니다. 따라서 스프링을 깊이 있게 이해하기 위해서는 먼저 스프링이 자주 사용하는 핵심 디자인 패턴들을 알아야 합니다.
강의에서 전달하는 핵심 디자인 패턴
템플릿 메서드 패턴
전략 패턴
템플릿 콜백 패턴
프록시 패턴
데코레이터 패턴
강의에서는 이러한 디자인 패턴들을 예제 코드로 하나하나 만들어보면서 아주 쉽게 설명해드립니다. 그리고 이렇게 학습한 디자인 패턴을 애플리케이션에 적용하는 방법도 알아봅니다.
2. 쓰레드 로컬
스프링은 주로 웹 애플리케이션 개발에 사용됩니다. 웹 애플리케이션은 동시에 여러 요청을 처리하기 위해 멀티쓰레드를 사용합니다. 따라서 여러 쓰레드가 경합하는 동시성 문제가 발생할 수 있습니다.
강의에서 전달하는 동시성 문제와 쓰레드 로컬 내용
웹 애플리케이션
멀티쓰레드
동시성 문제
강의에서는 스프링을 사용할 때 발생하는 동시성 문제를 알아보고, 또 동시성 문제를 편리하게 해결할 수 있는 쓰레드 로컬 개념까지 학습합니다. 쓰레드 로컬은 멀티쓰레드 환경에서 스프링이 어떻게 동시성 문제 없이 잘 작동하는지 이해하기 위한 필수 개념입니다.
3. 스프링 AOP
스프링 AOP는 실무에서 정말 많이 사용되는, 마치 마법처럼 느껴질 정도로 편리한 기술입니다. 많은 개발자가 스프링 AOP를 사용하지만, 스프링 AOP가 어떻게 동작하는지 그 원리를 정확하게 이해하고 사용하는 개발자는 많지 않습니다.
단순히 스프링 AOP의 기능만 알고 사용하는 단계를 넘어서, 스프링 AOP의 동작 원리를 깊이 있게 이해해야 장애가 발생했을 때 근본적인 문제 해결이 가능합니다.
강의에서 전달하는 스프링 AOP 내용
개념, 용어정리
프록시 - JDK 동적 프록시, CGLIB
동작 원리
실전 예제
실무 주의사항
강의에서는 스프링 AOP의 단순한 기능 정리를 넘어서 동작 원리부터 실전 예제, 그리고 실무에서 자주 발생하는 주의 사항까지 스프링 AOP의 모든 것을 정리해드립니다.
기타
추가로 스프링 컨테이너의 고급 기술인 빈 후처리기와 스프링 애플리케이션을 개발하는 다양한 실무 팁도 전해드립니다.
스프링 컨테이너의 확장 포인트 - 빈 후처리기
스프링 애플리케이션을 개발하는 다양한 실무 팁
이 강의를 시작하기 전에
고급편인 만큼 이 강의에서 다루는 내용들은 쉬운 내용들이 아닙니다. 하지만 실력 있는 백엔드 개발자가 되려면 반드시 한번은 공부해야 하는 내용입니다. 포기하지 않고 이 강의를 끝까지 따라오시면 여러분은 개발자로서 엄청난 내공 상승을 경험하고 누구보다 자신있게 스프링을 사용하실 수 있게 됩니다. 어려운 내용이니만큼 저도 철저하게 강의를 준비했습니다. 여러분이 이 내용들을 본인 것으로 완성할 수 있게 도와드리겠습니다.
이 강의를 이런 분들께 추천합니다
스프링을 더 깊게 알고 싶은데…
스프링의 고급 개념을 학습함으로써 실력을 더 키우고 싶은 분
스프링 AOP를 사용하기는 하는데…
스프링 AOP의 동작 원리를 정확하게 이해하고 싶은 분
스프링을 코드로 이해하고 싶은데…
디자인 패턴을 통해 스프링의 내부 기술을 이해하고 싶은 분
스프링으로 웹 앱을 만들 생각인데…
쓰레드 로컬을 통해 스프링 동시성 문제를 이해하고 싶은 분
앞으로 이어질 스프링 완전 정복 시리즈
스프링을 완전히 마스터할 수 있는 시리즈를 준비하고 있습니다. 실제 실무에서 사용하는 핵심 스프링 기능을 중심으로, 실무에서 쓰이지 않거나 오래된 기능은 과감하게 생략한 실무 노하우를 전수해드릴 예정입니다.
This time it was really long. I was so happy that I could finally understand AOP, one of the three major technologies of Spring. It was like an impregnable technology to me, like pointers in the C language.
I really liked how you explained it step by step this time. I don't think there is a lecture or book that teaches AOP this easily. If you want to learn about Spring in earnest, you should definitely read it.
And as a thank you to Yeonghan, I'm going to write about my Spring developer challenge.
==============
When you try something new, you really need a lot of energy at first.
...(omitted)...
First of all, it's really important to make a study habit. And when it comes to studying development, you have to try everything and code. You can never make it yours by just reading books and listening to lectures.
I recommend that you study consistently for 3-4 hours on weekdays and 8 hours on weekends.
===============
October 2020. I have been a Python developer so far, and I acknowledged that my career was at its limit and wanted to change my career to the Spring backend, so I sent an email to Younghan asking for advice. At that time, I received the above response from Younghan. It was a bit shocking, and I felt that I needed a lot of determination.
In terms of years of experience, I was already at the senior level, and since I only knew a little about Java, the challenge was really difficult. I failed the interview repeatedly. I remember that when I failed the interview with Woowa Brothers early last year, I didn't study well for almost a month and a half.
As Younghan said, 3-4 hours was realistically difficult, but I tried to do at least half of that.
In fact, the content of this lecture was not mentioned often during the interview, but thanks to the content of the lecture that Younghan covered, I was able to develop an eye for looking at backend technology more deeply, which was the most helpful. And the fact that I had to study at a much higher standard. (I think I tried to make the derived content from the lecture my own.)
My efforts worked... I went to one of the Nekaraku Cups at the end of March this year. I still feel inadequate, but I am excited and a little worried because the long 1.5 year preparation period has ended and the opportunity has been given.
When COVID is over and I get used to my new position, I will go and thank you in person. Thank you, Younghan.
I sincerely congratulate you, Pil-hwan.
It is easy for anyone to have momentary passion, but I think it is not easy to make it a habit and systemize it like Pil-hwan and continue it sustainably.
In particular, since the language you have developed so far is not Java and you have a lot of experience, I thought it would be more disadvantageous to get a job at a good company than an average junior developer.
In that sense, I can see how much effort Pil-hwan has put in, and I think it is a great achievement that you have created yourself.
Also, since you have a lot of experience, you must have been asked a lot about how to actually apply it in practice rather than the basics, so I think it is good that you have acquired it beyond simply learning the lecture content to cover these areas.
Since most companies are currently short of developers, I think anyone can get a job at a good company if they study and acquire the corresponding skills, as I advised Pil-hwan.
Lastly, I also had difficult days when it came to getting a job and changing jobs, and I think Pil-hwan's article will be a great help to those preparing for getting a job or changing jobs. I sincerely thank you.
Spring AOP Education Masterpiece. The best lecture
I'm sorry to the instructor that the maximum number of stars I can give is only 5. Thank you so much for the great lecture.
As a side note, if you practice following the instructor's code and then debug the internal implementation logic of SpringObjenesis, CGLIB, and JDK dynamic proxy (ProxyFactory, ObjenesisCglibAopProxy, etc.) separately, you will probably get much more out of it.
Personally, I debugged the moment of initialization with ProxyFactory proxyFactory = ProxyFactory(Component without interface); and went through various procedures according to the rules until I saw with my own eyes that it uses objenesis when creating and returning a proxy object as the result value of getProxy(). If I hadn't watched the lecture, I would not have understood anything because I didn't know the outline of the workflow at all.
Also, I felt that my understanding of Spring AOP greatly improved while separately looking into the process in which the AspectJAutoProxyRegistrar class related to EnableAspectJAutoProxy gets types annotated with @Aspect and uses BeanPostProcessor in the subsequent logic to register proxy objects as Spring beans instead of actual objects.
I am deeply grateful that you showed me the big picture first so that I could understand the detailed operation of the actual logic.
It seems like Younghan's lecture is not about opening a door, but about holding the doorknob and turning it. Thank you for always showing such great lectures.
After reading Toby's Spring Chapter 6, I had a mental breakdown and put the book down for a while, but I'll have to finish this lecture and go back to reading it.
(Review after completing the lecture)
At first, I was overwhelmed by the size of the lecture, which was 125 lectures, but as I listened to it, I understood why the lecture size was so large.
As you said at the end of the lecture, I'll try to get through more code and look at more references.
Now, I'll have to go study other design patterns that I don't understand enough.
I'll come back next time with a better look.^^
This was the first time since Supporters that I contributed to the lecture (manual) even a little bit, so it was a more meaningful advanced lecture than the previous lectures. I hope you will continue to give good lectures :)