php - Designing more sophisticated models than simple Db Table models -


i've been using zend's mvc structure while now, far models have been restricted reflecting individual database tables. i'm not sure go here when comes writing models reflect more complicated structures (eg many many relational database). know of resources/tutorials (preferably online, book recommendations appreciated too) on how approach designing more complex models?

sounds you're ready layer of abstraction. here's 3-tier system:

  1. data layer: touches db
  2. business logic layer: operates on data, interchanges to/from 1) , 3)
  3. application / controller layer: accepts input, asks business logic when doing anything, never touches "unsanitized" data layer directly.

note tiered architecture aside rest of presentation framework. should still have template system , application layer implement that; business , data layers dealing data only. technique centralizes business logic , allows swap out other layers little effort possible. (not meaning easy, easy-er.)

see here bit of information extending little beyond current approach. and, see here bit of strategy business logic layer. don't talk separate data layer, that's still advising.

to elaborate on net effect of increased code maintainability, system change out db (mysql postgre still painful, possible) , need change 1 layer of code. furthermore, technique how applications such phpbb able support multiple database engines, using of same logic , presentation code possible. allow swap out ui , create 1 interacts business objects implement business logic, separate controller logic behind view.


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -