Question: Aspect-oriented programming (AOP) is designed to organize code that does not naturally break down into a good class organization. It addresses cross-cutting concerns that can
Aspect-oriented programming (AOP) is designed to organize code that does not naturally break down into a good class organization. It addresses cross-cutting concerns that can span across large portions of your code base.
The canonical AOP example is a logging framework. If you are using Java's logger, and later decide to switch to Apache's Log4j framework, you might have to modify every .java file on your system.
In this lab, you will use JS proxies to create a tracing API. Any changes to the object should be logged by the proxy (using console.log). So if the original object was passed to a function like so:
someElaborateFunction(object);
You can change the call to:
someElaborateFunction(trace(object));
Then, you can observe all changes done to the object and troubleshoot any problems that arise. No changes to "someElaborateFunction" are needed.
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
