Bean Lifecycle - Overview - Spring Framework Tutorial
Bean Lifecycle - Overview is a free tutorial by Chad Darby from Spring Framework course
Link to this course(Special Discount):
https://www.udemy.com/course/spring-hibernate-tutorial/?ranMID=39197&ranEAID=Gw%2FETjJoU9M&ranSiteID=Gw_ETjJoU9M-Ce79s61TJQHSHorwuvyNrA&LSNPUBID=Gw%2FETjJoU9M&utm_source=aff-campaign&utm_medium=udemyads
This is the best Spring Framework Course
Course summary:
Develop a REAL-TIME project with Spring MVC, Spring REST, Spring Boot and Hibernate CRUD ... all from SCRATCH
You will TYPE IN EVERY LINE of code with me in the videos. I EXPLAIN every line of code to help you learn!
LEARN key Spring 5 features: Core, Annotations, Java Config, AOP, Spring MVC, Hibernate and Maven
I am a RESPONSIVE INSTRUCTOR ... post your questions and I will RESPOND in 24 hours.
POPULAR VIDEOS for: Spring Boot 2, Spring Security, Spring REST, Spring Data JPA, Spring Data REST and Thymeleaf
Join an ACTIVE COMMUNITY of 140,000+ students that are already enrolled! Over 38,000+ Reviews - 5 STARS
Students have LANDED NEW JOBS with the skills from this course. Spring and Hibernate developers are in HIGH-DEMAND!
You can DOWNLOAD all videos, source code and PDFs. Perfect for offline LEARNING and REVIEW.
English
Instructor: In this video, we're gonna discuss bean lifecycle methods. So when the Spring container first starts there are a couple of things that happens. First off, the beans are instantiated, and then the actual dependencies are injected, next you have some internal Spring processing that occurs with the bean factory, and then you have the option of adding your own custom initialization code, and then at that point the bean is ready for use. So you can call methods on it, do work with the bean, so on and so forth. At a certain point the containers actually shutdown meaning your application is shutdown like what context.close, then you also have a chance to call your custom destroy method, and that code'll execute before the actual application is stopped or before the actual beans lifecycle is over. The one thing you want to take a look at are those two orange sections here adding your own custom methods. What you can do is you can add your own custom code that happens during bean initialization. So you can call custom business logic, you can set up handles, so like databases, or sockets, or whatever. You can also do a similar thing when a bean is actually being destroyed or destructed. So again, you can call any custom business methods, or you can clean up any handles that you may have to resources like databases, sockets, or files. So basically what this provides here is that during the bean lifecycle, Spring allows you to call some of your custom code, and these are what we call hooks, where you can actually hook in codes to execute during bean initialization or bean destruction. All right, so now, how would you do this? Well, you simply make configuration entry in your XML file. So for bean initialization, you make use of this attribute called init-method, and then you give the actual method name that you would like for Spring to call on your bean. Now this method name can be any method name. Here I called doMyStartupStuff. It could be called fubar or whatever, and we can also do a similar thing for the destroy method. So again, you simply make a configuration entry here in your XML file. You simply give the method name you want Spring to call for destroy, and again, it can be any name. All right, so this all looks kinda good. What's the basic development process? So again, I love my step-by-step. So the first thing you do is you simply define your methods for the init and destroy in your bean class, then the next step is you simply configure those method names in the Spring configuration file, and in the next video, we'll dive into Eclipse, and we'll actually walk through this development process, and we'll test out this feature. So I'll see you in the next video.
Bean Lifecycle - Overview Spring 5: Learn Spring 5 Core, AOP, Spring MVC, Spring Security, Spring REST, Spring Boot 2, Thymeleaf, JPA & Hibernate
Что делает видео по-настоящему запоминающимся? Наверное, та самая атмосфера, которая заставляет забыть о времени. Когда вы заходите на RUVIDEO, чтобы посмотреть онлайн «Bean Lifecycle - Overview - Spring Framework Tutorial», вы рассчитываете на нечто большее, чем просто загрузку плеера. И мы это понимаем. Контент такого уровня заслуживает того, чтобы его смотрели в HD 1080, без дрожания картинки и бесконечного буферизации.
Честно говоря, Rutube сегодня — это кладезь уникальных находок, которые часто теряются в общем шуме. Мы же вытаскиваем на поверхность самое интересное. Будь то динамичный экшн, глубокий разбор темы от любимого автора или просто уютное видео для настроения — всё это доступно здесь бесплатно и без лишних формальностей. Никаких «заполните анкету, чтобы продолжить». Только вы, ваш экран и качественный поток.
Если вас зацепило это видео, не забудьте взглянуть на похожие материалы в блоке справа. Мы откалибровали наши алгоритмы так, чтобы они подбирали контент не просто «по тегам», а по настроению и смыслу. Ведь в конечном итоге, онлайн-кинотеатр — это не склад файлов, а место, где каждый вечер можно найти свою историю. Приятного вам отдыха на RUVIDEO!
Видео взято из открытых источников Rutube. Если вы правообладатель, обратитесь к первоисточнику.