Although we have extracted SQL statements, the page scripts and classes are probably manipulating the results and performing other actions related to the retrieved data. These manipulations and actions are the core of the domain logic, and it is currently embedded along with other non-domain concerns.
We can see an example of the progression from embedded SQL to using Gateway classes by examining the differences between the code in Appendix B, Code before Gateway and Appendix C, Code after Gateway. The code is too lengthy to present here. What we want to notice is that even after extracting the embedded SQL statements, the code is still doing a lot of work with the incoming and outgoing data before the results are presented to the user.
Having the domain logic embedded in the page script makes it very difficult to test that logic in isolation. We also cannot reuse it easily. If we wanted to search for repetition and duplication in how we work with the domain entities...