Skip to content
academia.sh

Course Intermediate

The Web Application Framework

Published Updated

By the end of this course

Start course

01

Framework Fundamentals

Inversion of control, the request–response lifecycle, routing, controllers, middleware, the object container and facades — each as a mechanism that decides whether a piece you wrote is called in this request.

  1. 01 Why a Framework A comparison of an if chain whose flow the script drives with a route registration whose flow the framework drives, and a twelve-part measurement built on four names that classify whether a part ran in this request.
  2. 02 The Request–Response Lifecycle The boot phases of service providers, the way the kernel handles a request, and the way work that runs after the response is sent stays outside the response; a comparison of deferred work with work called directly.
  3. 03 Routing Route patterns, parameters, groups and named routes; the first matching route in registration order wins, and a route can be left unwired in the shadow of another route.
  4. 04 Controllers The controller class and the action method, the resource controller exposing seven actions as routes, and the single-action controller; the resolution of constructor dependencies by the object container.
  5. 05 Middleware Moving cross-cutting concerns into layers placed in front of the action, the request passing through the layers to reach the action, the call to $next being made or not made, and the order of the links deciding the result.
  6. 06 Object Container and Facades Binding in the object container, singleton binding and autowiring, a second binding to the same name silently overwriting the first, and the facade resolving the object from the container on every call.

02

Views and Data

The template engine, forms and validation, object–table binding, relationships, migrations and seeding, pagination and resource transformation — each as a mechanism that decides whether a record, a rule or a field takes part in this request.

  1. 01 The Template Engine A template compiler with layouts, components and loops is built; the lesson measures that escaping runs on every output, that compilation is skipped for an unchanged template, and that escaping is not wired on raw output.
  2. 02 Forms and Validation A validator that works with rule strings is built; the lesson measures that the save step is skipped on invalid input, runs on valid input, and that stopping at the first error skips the next rule.
  3. 03 Object–Table Binding A small model class that keeps the table as a PHP array is built; the lesson measures that the save hook runs on save, that a field outside the allow list is not wired in mass assignment, and that the hook is not wired in a bulk update.
  4. 04 Relationships One-to-one, one-to-many and many-to-many relationships are built in a small model; the lesson measures that with lazy loading the relationship query is deferred until access, that with eager loading it runs together with the list, and that a relationship never accessed stays deferred.
  5. 05 Migrations and Seeding Migrations that version the schema and a seeder that writes starting data are built; the lesson measures that a recorded migration is skipped on the second run, that a new migration runs, and that editing a migration file that has already run is not wired.
  6. 06 Pagination and Resource Transformation Offset pagination and a resource transformation from model to response array are built; the lesson measures that a new column added to the model is not wired to the response because it is not in the transformation definition, that it runs once added to the definition, and that a request outside the page range returns an empty list.

03

Application Services

Authentication and authorization, queues, events, notifications, caching, file storage, scheduled tasks, localization and testing — each as a mechanism that decides whether a piece of work runs in the request, later, or not at all.

  1. 01 Authentication and Authorization Storing and verifying a password as a hash, the user in the session, the gate and the policy; a legitimate user asking to edit someone else's post, the gate returning 403 and the action being skipped; the principle that an undefined ability is denied.
  2. 02 Queues and Jobs The job class, pushing onto a queue and the worker; a job pushed onto the queue being deferred at response time while the same job runs on the sync driver; a job that fails on its first attempt being retried and falling into the failed jobs list when its attempts run out.
  3. 03 Events and Listeners The event, the listener and the dispatcher; separating side effects from the controller; a listener not being wired when the registered name does not match the dispatched name, a queued listener being deferred, and giving the event name as a class name catching the mismatch at registration.
  4. 04 Notifications The notification class, the notification channel and the recipient's channel preference; the chosen synchronous channels running and the unchosen channel not being wired; the same channels being deferred when the notification is marked as queued.
  5. 05 Caching The key-based cache, the time to live, the remember function and invalidation; the computation being skipped on a hit and running after invalidation; recomputation when the time to live ends, and the current record not reaching the response when invalidation is forgotten.
  6. 06 File Storage The disk abstraction: the local disk and the in-memory disk behind the same interface; the same upload call running on two disks, a disk not named in the configuration not being wired, and a change of disk showing up in the life of the file and not in the response.
  7. 07 Scheduled Tasks The recurring task definition, the frequency words and the scheduler tick; a task registered in a request running on the tick, a task whose time has not come being skipped on the tick, and the limit the tick interval puts on the task frequency.
  8. 08 Localization Language arrays, placeholders, plural forms and the fallback language; the text of the requested language not being wired when the key is missing and the fallback language stepping in without an error, the requested language running when the key exists and the fallback language hiding a missing translation.
  9. 09 Testing The feature test and the unit test, a small verification function; a job being recorded but not running in a fake queue, the job running once the queue is drained, and the fake queue not measuring the body of the job.

Final exam

The Web Application Framework — Final Exam

In preparation

This course's question bank is not complete yet. The exam opens here automatically once enough questions are added.

Start typing to search.

↑↓ ↵ Esc navigate · open · close