Johnder Perez

Step 2 of 6

Separation of concerns and layers


Keep the UI, the business rules and the data access in separate places. A typical split: components (what it looks like), services or server functions (what it does), and a data layer (how it's stored).

Why it matters when you build with AI: When the AI puts a database query, pricing logic and HTML into one component, every future change risks breaking all three.

Quick check

A component that queries the DB, computes prices and renders HTML is…

← Previous step Next: SOLID and design patterns, in plain English →