jwaterworth / php-dynamics-crm-2011

Automatically exported from code.google.com/p/php-dynamics-crm-2011
0 stars 0 forks source link

Cache the definitions of Entity Objects #12

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Currently, whenever a new DynamicsCRM2011_Entity Object is created, the 
definition of the Entity is fetched from the Server.

This means that if multiple Entities of the same type are created (for example, 
as planned for the RetriveMultiple request), the same request will be sent to 
the server multiple times, which a very large response to be parsed each time.

Instead, the ciritical properties of the Entity should be cached.  This Cache 
should be stored in the DynamicsCRM2011_Connector Object, as potentially two 
different connections to different servers could have different definitions of 
the same Entity.

Original issue reported on code.google.com by N.M.Pr...@gmail.com on 16 Mar 2012 at 2:28

GoogleCodeExporter commented 9 years ago
Needs to be done

Original comment by N.M.Pr...@gmail.com on 16 Mar 2012 at 2:34

GoogleCodeExporter commented 9 years ago
High priority - this needs to be done before we start "Strongly Typing" results 
from queries.

Original comment by N.M.Pr...@gmail.com on 16 Mar 2012 at 4:27

GoogleCodeExporter commented 9 years ago

Original comment by N.M.Pr...@gmail.com on 16 Mar 2012 at 4:28

GoogleCodeExporter commented 9 years ago

Original comment by N.M.Pr...@gmail.com on 16 Mar 2012 at 4:28

GoogleCodeExporter commented 9 years ago
I'll pick this one up

Original comment by N.M.Pr...@gmail.com on 16 Mar 2012 at 4:30

GoogleCodeExporter commented 9 years ago
Three fields to be cached:
* $entityData - the SimpleXML Object that describes the Entity
* $properties - the Array of Attributes of the Object
* $mandatories - the Array of Required Attributes of the Object

Cache to be indexed according to EntityLogicalName

Three functions required on the Connector:
* isEntityDefinitionCached($entityLogicalName)
* getCachedEntityDefinition($entityLogicalName, SimpleXML &$entityData, Array 
&$propertiesArray, Array &$mandatoriesArray)
* setCachedEntityDefinition($entityLogicalName, SimpleXML $entityData, Array 
$propertiesArray, Array $mandatoriesArray)

One private property required on the Connector:
* cachedEntityDefinitions = Array();

Original comment by N.M.Pr...@gmail.com on 16 Mar 2012 at 8:43

GoogleCodeExporter commented 9 years ago
Fixed & Tested

Original comment by N.M.Pr...@gmail.com on 16 Mar 2012 at 9:29