2. QUESTION
Why do you use web framework instead of plain PHP?
Separation of cross-cutting concern
3. SEPARATION OF CROSS-CUTTING CONCERN
▸ Cross-cutting concerns are aspects of a program that affect
other concerns. These concerns often cannot be cleanly
decomposed from the rest of the system in both the
design and implementation, and can result in either
scattering (code duplication), tangling (significant
dependencies between systems), or both.
▸ Examples: authentication, authorization, caching,
communication, configuration, exception management,
logging, routing, and validation
5. ▸ Auditing
▸ There is an enterprise system which requires to record all
the operations by the users for security.
EXAMPLE OF CROSS-CUTTING CONCERN 1
6. ▸ Performance logging
▸ There is a system which requires the high performance in
order to provide higher user experience to the users.
EXAMPLE OF CROSS-CUTTING CONCERN 2
7. ▸ Exception handling
▸ There is a system which requires to handle the exceptions
and write errors in a log file so that the system will be able
to notify system administrators in real time through e-mail.
EXAMPLE OF CROSS-CUTTING CONCERN 3
8. HOW TO USE EVENT SYSTEM IN CAKEPHP
▸ One of the way to separate cross-cutting concerns in
CakePHP is event system.
▸ The way to handle events is just attach listeners and
dispatch events.
▸ Example: http://martinbean.co.uk/blog/2013/11/22/
getting-to-grips-with-cakephps-events-system/
9. EVENT SYSTEM USED IN CAKEPHP FRAMEWORK
▸ Controller, Components and Model use the event system.
The system saves records consist of user ID, operated date time, kind of operation and how the data was operated such as SQL statement.
Every time we find a performance problem, we need to examine how much the system is slow and which part of the system causes the problem.
Once the system administrators notice the problems, they will be able to fix it before many users are suffered from it and give up to use the system or complain to the system administrators.