Review and next steps
When we have completed this step, all of our SQL statements will be inside Gateway classes, and no longer in our page scripts or other non-Gateway classes. We will also have tests for our Gateway classes.
From here on out, any time we need to add new calls to the database, we will do so only in the Gateway classes. Any time we need to fetch or save data, we will use the Gateway methods instead of writing embedded SQL. This gives us a clear separation of concerns between the database interactions and our future model layer and entity objects.
Now that we have separated our database interactions into their own layer, we are going to inspect all the calls to the Gateway objects throughout the legacy application. We will examine ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access