Design the DB interface for a single purpose. This purpose is usually creating, updating and deleting a row of data. DB interfaces should be as autonomous as possible because that makes it easier to use them as a group. It is easier to combine the operations of multiple interfaces when each interface has a well-defined set of operations. (See example below.)
Large applications that have many database tables result in many DB interfaces. Standardizing the way database interfaces are built makes them a lot easier to work with and become familiar with. Use a standard naming scheme, layout and implementation to simplify using multiple interfaces together.
A single DB Interface is fairly limited in its usefulness. DB interfaces become very useful when their functionality is grouped together to perform a real task. Here is an example in which multiple database interfaces are combined to complete a new message posting on a forum:
This article provided an introduction to using the DB interface design model for creating applications. As PHP applications become increasingly complex, they inevitably become more difficult to manage. Database interfaces provide a mechanism and a methodology for building more manageable applications faster and easier.
| DISCLAIMER: The content provided in this article is not warranted or guaranteed by Developer Shed, Inc. The content provided is intended for entertainment and/or educational purposes in order to introduce to the reader key ideas, concepts, and/or product reviews. As such it is incumbent upon the reader to employ real-world tactics for security and implementation of best practices. We are not liable for any negative consequences that may result from implementing any information covered in our articles or tutorials. If this is a hardware review, it is not recommended to open and/or modify your hardware. |