Prev | Current Page 65 | Next

Emilian Balanescu and Cristian Darie

"Beginning PHP and MySQL E-Commerce: From Novice to Professional, Second Edition"

Otherwise, keeping all the
business rules in the middle tier is preferable, because it generates a cleaner application that
is easier to maintain.
Finally, don??™t be tempted to access the data tier directly from the presentation tier. This is
a common mistake that is the shortest path to a complicated, hard-to-maintain, and inflexible
system. In many data access tutorials or introductory materials, you??™ll be shown how to perform
basic database operations using a simple user interface application. In these kinds of programs,
all the logic is probably written in a short, single file, instead of separate tiers. Although the
materials might be very good, keep in mind that most of these texts are meant to teach you
how to do different individual tasks (for example, access a database), and not how to correctly
create a flexible and scalable application.
A Three-Tier Architecture for TShirtShop
Implementing a three-tier architecture for the TShirtShop web site will help achieve the goals
listed at the beginning of the chapter. The coding discipline, imposed by a system that might
seem rigid at first sight, allows for excellent levels of flexibility and extensibility in the long run.
Splitting major parts of the application into separate smaller components encourages
reusability. More than once when adding new features to the site, you??™ll see that you can reuse
some of the already existing bits.


Pages:
53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77
www.books61.hobbitstory.com tanie noclegi międzyzdroje pokoje windsurfing Władysławowo noclegi e-lady