У нас вы можете посмотреть бесплатно Spring | Aspect Oriented Programming with Spring или скачать в максимальном доступном качестве, видео которое было загружено на ютуб. Для загрузки выберите вариант из формы ниже:
Если кнопки скачивания не
загрузились
НАЖМИТЕ ЗДЕСЬ или обновите страницу
Если возникают проблемы со скачиванием видео, пожалуйста напишите в поддержку по адресу внизу
страницы.
Спасибо за использование сервиса ClipSaver.ru
Spring Boot AOP The application is generally developed with multiple layers. A typical Java application has the following layers: o Web Layer: It exposes the services using the REST or web application. o Business Layer: It implements the business logic of an application. o Data Layer: It implements the persistence logic of the application. The responsibility of each layer is different, but there are a few common aspects that apply to all layers are Logging, Security, validation, caching, etc. These common aspects are called cross-cutting concerns. If we implement these concerns in each layer separately, the code becomes more difficult to maintain. To overcome this problem, Aspect-Oriented Programming (AOP) provides a solution to implement cross-cutting concerns. AOP Terminology o Aspect: An aspect is a module that encapsulates advice and pointcuts and provides cross-cutting An application can have any number of aspects. We can implement an aspect using regular class annotated with @Aspect annotation. o Pointcut: A pointcut is an expression that selects one or more join points where advice is executed. We can define pointcuts using expressions or patterns. It uses different kinds of expressions that matched with the join points. In Spring Framework, AspectJ pointcut expression language is used. o Join point: A join point is a point in the application where we apply an AOP aspect. Or it is a specific execution instance of an advice. In AOP, join point can be a method execution, exception handling, changing object variable value, etc. o Advice: The advice is an action that we take either before or after the method execution. The action is a piece of code that invokes during the program execution. There are five types of advices in the Spring AOP framework: before, after, after-returning, after-throwing, and around advice. Advices are taken for a particular join point. We will discuss these advices further in this section. There are five types of AOP advices are as follows: Before Advice: An advice that executes before a join point, is called before advice. We use @Before annotation to mark an advice as Before advice. After Advice: An advice that executes after a join point, is called after advice. We use @After annotation to mark an advice as After advice. Around Advice: An advice that executes before and after of a join point, is called around advice. After Throwing Advice: An advice that executes when a join point throws an exception. After Returning Advice: An advice that executes when a method executes successfully. Before implementing the AOP in an application, we are required to add Spring AOP dependency in the pom.xml file.