liveBook · Manning

Separation of concerns

As explained in Rust Servers, Services, and Apps

Separation of responsibilities is a design principle that assigns distinct concerns to different software components.

Separation of concerns assigns distinct responsibilities to different software components. In a tutor service, the backend applies business and data-access rules, while the frontend manages authentication and sessions. section 8.2

A registration flow divides work across the system:

  • The browser displays the registration form and performs basic required-field and length validation. section 8.2
  • The frontend receives submitted credentials, handling user authentication and session management. section 8.2
  • The backend web service stores tutor and course data and enforces core business rules. section 8.2

Tutor registration

A browser requests `/`, an Actix handler renders a Tera registration template, and form submission sends a POST request to `/register`. The trusted backend remains behind the firewall and accepts requests from the frontend. section 8.2

Figure 8.2 Tutor registration flow

Follow the tutor registration flow from the landing page through form submission and backend processing. section 8.2

How Rust Servers, Services, and Apps covers it

How deep it goes
Explains component boundaries through a registration workflow but stops short of detailing broader decomposition strategies.
Examples
Uses tutor registration, browser validation, Actix routes, a Tera template, and a trusted backend deployment boundary.
What it assumes
Assumes an existing tutor web service with add, update, and delete APIs, while demonstrating the frontend boundary in context.
What you can do after
Apply the principle by dividing a registration system between frontend interaction and backend rules and persistence.
How it connects
Connects frontend applications with backend services, authentication, session management, business logic, and data access.

Also explained in

Compare how 22 books explain separation of concerns →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Rust Servers, Services, and Apps. The section links point to the parts of the book it draws on.