< Return to Video

What is AOP - Aspect Oriented Programming

  • 0:00 - 0:04
    PRESENTER: In this lecture, you will learn what AOP is.
  • 0:04 - 0:09
    AOP stands for Aspect-Oriented Programming.
  • 0:09 - 0:11
    This can be best understood by looking at
  • 0:11 - 0:15
    an enterprise application which is typically divided into layers:
  • 0:15 - 0:18
    UI layer, business logic layer,
  • 0:18 - 0:20
    data access layer, and many more.
  • 0:20 - 0:23
    All these layers typically have
  • 0:23 - 0:26
    some non-functional requirements like security, profiling,
  • 0:26 - 0:32
    logging, transaction management when we are especially using a database or a MQ system.
  • 0:32 - 0:37
    Logging to write our errors or information to the log files,
  • 0:37 - 0:40
    profiling to see how our application is performing,
  • 0:40 - 0:43
    and security, you know what it is for.
  • 0:43 - 0:48
    These are called cross-cutting concerns because these are required across
  • 0:48 - 0:51
    these layers as well as across
  • 0:51 - 0:55
    the applications in our enterprise or even another enterprise.
  • 0:55 - 1:00
    Any application we develop will need all these and more.
  • 1:00 - 1:06
    That is where aspects come in and Aspect-Oriented Programming comes in.
  • 1:06 - 1:09
    In object-oriented world, we define a class
  • 1:09 - 1:13
    and object is the key unit that are present in that class.
  • 1:13 - 1:15
    In the aspect-oriented world,
  • 1:15 - 1:17
    an aspect is the key unit.
  • 1:17 - 1:20
    You can think of it as a specialized class
  • 1:20 - 1:25
    that addresses one of these cross-cutting concerns.
  • 1:25 - 1:26
    It could be security,
  • 1:26 - 1:30
    profiling, logging, transaction management, etc.
  • 1:30 - 1:38
    These aspects can be applied to our classes and objects at runtime.
  • 1:38 - 1:40
    Doing that, will have several advantages.
  • 1:40 - 1:44
    Number 1, cross-cutting concerns, as I already said.
  • 1:44 - 1:48
    We can address all the non-functional requirements which are
  • 1:48 - 1:53
    common across the enterprise or even enterprises,
  • 1:53 - 1:55
    allowing us to reuse.
  • 1:55 - 1:57
    Once we develop an aspect,
  • 1:57 - 2:03
    we can apply it across classes in our application and across applications.
  • 2:03 - 2:07
    Quick development, we can focus on our business logic without
  • 2:07 - 2:11
    worrying about the non-functional requirements because we already
  • 2:11 - 2:14
    have the aspects and we can apply them or we can
  • 2:14 - 2:18
    create an aspect later on and we can apply it.
  • 2:18 - 2:20
    Focus on one aspect.
  • 2:20 - 2:23
    Using this, we can specialize. A particular developer if
  • 2:23 - 2:26
    he is interested in working on security aspect,
  • 2:26 - 2:28
    you can develop an aspect for that.
  • 2:28 - 2:31
    Another developer can work on logging,
  • 2:31 - 2:35
    transaction management, etc, which will allow specialization.
  • 2:35 - 2:42
    Finally, a powerful feature is enabling and disabling aspects at runtime.
  • 2:42 - 2:45
    We can enable them and we can disable them
  • 2:45 - 2:49
    using configuration if we don't need them anymore.
  • 2:49 - 2:52
    There are several popular frameworks in the open-source.
  • 2:52 - 2:55
    Java will do implement Aspect-Oriented Programming.
  • 2:55 - 2:58
    Spring and aspect here are two popular ones.
  • 2:58 - 3:01
    Spring also works together with
  • 3:01 - 3:06
    AspectJ and it has its own implementation of aspects as well.
Title:
What is AOP - Aspect Oriented Programming
Description:

more » « less
Video Language:
English
Team:
BYU Continuing Education
Project:
CS-204 (BYUO)
Duration:
03:07

English subtitles

Revisions