文章详情

  • 游戏榜单
  • 软件榜单
关闭导航
热搜榜
热门下载
热门标签
php爱好者> php文档>Understanding the PAC framework of Druple

Understanding the PAC framework of Druple

时间:2010-10-31  来源:cy163

 

Understanding the PAC Framework for Drupal

July 6th, 2010 · No Comments

Drupal’s structure is known as a PAC (presentation abstraction control) model which uses a controller to represent logic, a presentation layer for design and an abstraction layer for data.  Similar to an MVC framework, the components are unique and primarily communicate via API. In the structure, the Controller servers as the go between of the Presentation and Abstraction, which is why the templates are generated through function calls. The presentation, therefore, is just a rendering of a template, so you can focus on building out the core of the site and styling via CSS. In order to understand how PAC differs from other framework models, this article provides a theoretical overview of PAC for web development.

PAC is unique in that the various levels communicate with each other so you can create a broad structure. Sometimes the framework is also known as HMVC, or hierarchical model view controller for its nested structure. With the depth of Drupal sites, it’s much easier to build large sites that can scale across multiple business models.

For developers and publishers, this framework provides a way to create new membership structures and enables layers of the site to reflect unique presentation. One common example would be in an e-commerce site where the presentation for existing customers could be adapted to reflect their purchasing preferences. In this way you can utilize your site data to optimize its audience specific presentation. With a flexible structure, you can modify your Drupal app to derive more revenue and better value for each visitor.

How the PAC Structure Impacts the Drupal Model

In Drupal, the PAC structure provides a flexible framework for scale-able development. Menus in Drupal serve as controllers, which receive input via POST (or GET) functions, while data is stored in nodes, forms and entries in the Abstraction layers and the theme system provides a Presentation layer. While the overall structure may be new to many developers, its consistent logic and streamlined development can help accelerate and scale applications to new levels.

At the core the control layer plays a crucial role in gathering and transmitting data. With dual feedback between the abstraction and presentation layers, developers should focus on the control as the core of data transmission and structuring. The Presentation layer is solely to render the template, which itself makes API calls from functions as well as styling with CSS. At the back-end, the Abstraction layer provides storage for data in a SQL database (although recent versions of Drupal are compatible with a wide array of options.)

There are multiple PAC layers within Drupal which allows you to create a dynamic structure so the presentation and functions of the site are conditional upon the user, time or particular section. For example, the controller receives inputs from the user in terms of preferences; it may update the Presentation as well as storing the preference in the Abstraction layer. The controller can then update the child PAC elements so the entire user experience across the application reflects the newly entered preferences.

Related Posts

  • How to Integrate and Develop Drupal Design Themes
  • Comparing Drupal to Other Open Source CMS Options
  • Enterprise Drupal Sites as Developer Guides
相关阅读 更多 +
排行榜 更多 +
辰域智控app

辰域智控app

系统工具 下载
网医联盟app

网医联盟app

运动健身 下载
汇丰汇选App

汇丰汇选App

金融理财 下载