Extending core types is a pretty simple concept in the end. On application initilisiation we add a new value to the type strucutre, typePath. This typePath value is determined by the following:
- is it a core type?
- Yes
- is the type extended? (determined by cfc in appName/packages/system )
- Yes (typePath = application.extendedPackagepath.types.typename)
- No (typePath = application.packagepath.types.typename - standard core type)
- No (Custom type so typePath = application.customPackagepath.types.typename)
Having this value in the application types structure means there is no need for conditional code throughout the codebase testing for custom types etc to work out packagepath.
If for example you wanted to extend dmProfile you would create a cfc called dmProfile and save it your appName/packes/sytem directory so that it is picked up on initilisation (as above). This cfc would need to extend farcry.farcry_core.packages.types.dmProfile to inherit existing methods and properties. To add a new property called country for example , your extended cfc may look like this:
<cfcomponent extends="farcry.farcry_core.packages.types.dmProfile" displayName="Profiles">
<cfproperty name="country" type="string">
</cfcomponent>
Note you may need to write custom edit handlers etc for your extended types.
So really all that is required to implement this change is to update the initilisation code to set this typePath variable, and then modify all createObject calls to use this typePath variable instead of application.packagepath or application.custompackagepath.
Sound easy? Anyone interested in implementing? :)
-Brendan http://farcry.daemon.com.au
--- You are currently subscribed to farcry-dev as: [EMAIL PROTECTED] To unsubscribe send a blank email to [EMAIL PROTECTED]
