Changes

m
Line 421: Line 421:  
=== Communication between business logic - data (ORM) ===
 
=== Communication between business logic - data (ORM) ===
   −
There is 3 way to make links:
+
There are 3 ways to make links:
    
* The '''Table And Row Data Gateway'''
 
* The '''Table And Row Data Gateway'''
This is the most simple. You have one class per table and each class is a link to the table with CRUD methods (Ceate, Read, Update, Delete). A class instance is a record a the table. The class contains only code to reach lines and fields of table.
+
This is the most simple. You have one class per table and each class is a link to the table with CRUD methods (Ceate, Read, Update, Delete). A class instance is a record in the table. The class contains only code to reach lines and fields of table.
    
Example: This mode is used by some ORM Frameworks, like '''iBatis''' (http://ibatis.apache.org/).
 
Example: This mode is used by some ORM Frameworks, like '''iBatis''' (http://ibatis.apache.org/).
    
* The '''Active Record'''
 
* The '''Active Record'''
Same than previous, but we are allowed to add some business functions into the class, if such functions are dedicated to the table or recordng into this table.
+
Same as previous, but we are allowed to add some business functions into the class, if such functions are dedicated to the table or recording into this table.
   −
Example: This mode is used for Dolibarr development and most PHP softwares that includes their own framework and best practices.
+
Example: This mode is used for Dolibarr development and most PHP softwares that include their own framework and best practices.
    
* The '''Data Mapper'''
 
* The '''Data Mapper'''
Classes represent entities of the problem and not the data. So you have to double, triple ... theese classes with Mapper classes to access the data.
+
Classes represent entities of the problem and not the data. So you have to double, triple ... these classes with Mapper classes to access the data.
 
More "purist" on paper (closer of business), this method also has the disadvantage of being more complex in practice.
 
More "purist" on paper (closer of business), this method also has the disadvantage of being more complex in practice.
  
304

edits