One thing you could do is use composition rather than extends to provide the
application functionality.

So instead of having 

<cfcomponent extends="somebasecomponent">


You would have something like this:

<cfcomponent>

<cffunction name="init" ...>
        <cfset variables.basecomponent =
createObject('component','#mappingpath#.somebasecomponent')>
</cffunction>


It might not be a perfect fit for how your architecture works if you rely
heavily on overriding methods and using super(), but otherwise it should
solve the problem.

Spike

--------------------------------------------
Stephen Milligan
Code poet for hire
http://www.spike.org.uk

Do you cfeclipse? http://cfeclipse.tigris.org 


 

>-----Original Message-----
>From: [EMAIL PROTECTED] 
>[mailto:[EMAIL PROTECTED] On Behalf Of Jurgen Stillaert
>Sent: Friday, May 21, 2004 6:22 AM
>To: [EMAIL PROTECTED]
>Subject: RE: [CFCDev] Constant values in attribute extends
>
>Hi Jeffry,
>
> 
>
>The structure is a follow:
>
>E:/
>
>            _website_development/
>
>                        baseComponent.cfc
>
>                        /OtherComponents/
>
>                                    component1.cfc
>
>                                    component2.cfc
>
>            _website_demo/
>
>                        baseComponent.cfc
>
>                        /OtherComponents/
>
>                                    component1.cfc
>
>                                    component2.cfc
>
> 
>
>            Websites/
>
>                        Website1/
>
>                                    Some cfc's extending 
>baseComponents above
>
>                        Website2/         
>
>                                    Some cfc's extending 
>baseComponents above
>
>                        Website2_demo/            
>
>                                    Some cfc's extending 
>baseComponents above
>
> 
>
>When I finished a component in 
>E:/_website_development/OtherComponents/ I copy it to 
>E:/_website_demo/OtherComponents/ for testing (for clients).
>
> 
>
>So I need to redirect the websites under E:/Websites/ to the 
>right components (and maps). But it seems that Cold Fusion 
>doesn't allow you to use variables in the extends attribute. 
>(and it's like cfinclude, and there it will work.).
>
> 
>
>My (stupid) solution is to enforce other webdevelopers to 
>change manually the extends attribute. But I hope that is not 
>the best solution that's out there.
>
> 
>
>-----Original Message-----
>From: [EMAIL PROTECTED] 
>[mailto:[EMAIL PROTECTED] On Behalf Of Jeffry Houser
>Sent: vrijdag 21 mei 2004 16:10
>To: [EMAIL PROTECTED]
>Subject: Re: [CFCDev] Constant values in attribute extends
>
> 
>
>
> I think you mean <cfcomponent extends=""> not cfmodule.  
>
> If your components are in the same directory, they can be 
>referred to as a package.  The "package" directory is the 
>first place the extends component is looked for (someone 
>correct me if this is wrong).  In this case, do you need to 
>specify a full directory or are your components located in the 
>same directory?  Would this: <cfcomponent 
>extends="BaseComponent">  work?  
>
>At 10:00 AM 5/21/2004, you wrote:
>
>
>
>Hello,
> 
>I'm developing on a website and I wanted to split up the 
>development code and stable and tested code (for demo).
> 
>So I made two mappings: website_development and website_demo 
>in ColdFusion administrator.
> 
>In application.cfm, I created an application.map variable with 
>one of the two above mentioned mappingnames.
> 
>I adapted the code of my cfc's from <CFMODULE extends = 
>"website_development.baseComponent"> to <CFMODULE extends = 
>"#application.map#.baseComponent">
> 
>But, when I run the program, I get this error "This expression 
>must have a constant value." And that is a major setback for me. :-(
> 
>Does someone know a work around for this?
> 
>Met vriendelijke groeten,
>Jurgen Stillaert
> 
>---------------------------------------------------------------
>---------------------
>Jurgen Stillaert
>Webdeveloper
> 
>RAMIT vzw
>c/o Dept. Medical Informatics & Statistics University Hospital 
>Ghent (5K3) De Pintelaan 185 9000 Ghent Belgium
> 
>Phone: +32 9 240 52 93
>Fax: +32 9 240 34 39
>E-mail: [EMAIL PROTECTED]
> 
> 
>
>--
>Jeffry Houser, Web Developer, Writer, Songwriter, Recording 
>Engineer <mailto:[EMAIL PROTECTED]>
>--
>AIM: Reboog711  | Phone: 1-203-379-0773
>--
>My Books: <http://www.instantcoldfusion.com 
><http://www.instantcoldfusion.com/> > Recording Music: 
><http://www.fcfstudios.com <http://www.fcfstudios.com/> > 
>Original Energetic Acoustic Rock: <http://www.farcryfly.com 
><http://www.farcryfly.com/> >
>
>

----------------------------------------------------------
You are subscribed to cfcdev. To unsubscribe, send an email
to [EMAIL PROTECTED] with the words 'unsubscribe cfcdev' 
in the message of the email.

CFCDev is run by CFCZone (www.cfczone.org) and supported
by Mindtool, Corporation (www.mindtool.com).

An archive of the CFCDev list is available at www.mail-archive.com/[EMAIL PROTECTED]

Reply via email to