thinkphp important concept

To grasp ThinkPHP, we must first understand a few important concepts which, for those familiar with Java development friends, should be easy to understand some of the concepts below.

Action object

Similarly the Struts framework and Action, Action is primarily to provide control and application logic processing, the belonging ThinkPHP control layer, performed by the core module parses App class operation and transmitted directly to the appropriate Action object processing. Action objects all application classes inherit Action system base class .

Dao objects

Refers DataAccessObject ( data access object ), Dao underlying design pattern to separate data access logic and business logic, business layer sandwiched between the data layer and for accessing and manipulating databases. It can be operated for single-table and multi-table. Dao ThinkPHP objects belong to transactional objects built on top of an abstract database access layer.

VO objects

Refers ValueObject ( data objects ), a more accurate to say that the business objects , as VO is viable in the business layer, the business logic for use. VO objects and tables there is a mapping relationship, the data table corresponding to each attribute of the object VO (or view ) of a field, you can add other non VO object attribute data table field, for business logic operations, e.g. the associated field. VO objects have a special reserved property _info, it is an array variable , used to hold some special information on the VO object. VO corresponding to the object and also the concept of PO (persistent data objects), the concept of VO and PO are from O / RMapping (ObjectRelationalMapping, object-relational mapping), PO only be used in the data layer (i.e. the object properties must be PO one correspondence and the data table), VO with the business logic and presentation layer (additional attributes can have their own). The layers were own operation belonging to the layer data object , which can reduce the coupling between the layers, ease of maintenance and future expansion of the system. If the PO used in the respective layers is equivalent to our use of global variables , we know very in favor of the use of global variables in OO design.

VoList objects

In ThinkPHP frame, after the query data set (ResultSet) data is converted into a list of objects, i.e. objects VOLIST, and ResultSet object except that each record corresponds to a target VO. And the operation can be easily traverse object VOLIST object VO. VO objects and entity objects VOLIST object belongs ThinkPHP frame is the basic element of the data operations. If you do not use Dao mode during development, but directly manipulate the database through database-driven class, it returns ResultSet object. The system provides a method ThinkPHP from VOLIST ResultSet object into the object.
Components and plug-in support
Role-based access control system
Enterprise-class application security is inseparable from protection, ThinkPHP based Spring of Acegi security system as a reference prototype, simplified and made to fit the current ThinkPHP structure, provides a multi-layered, customizable security system to serve application development to provide security control. Security system are: the security interceptor, authentication manager, decision-making Access Manager, Identity Manager runs.

Guess you like

Origin www.cnblogs.com/linqingvoe/p/10971478.html