Hi All, Coming in late, but though I might be able to help.
Rony, from your post I guess we're talking about a function that is shared across all your sites. You want the function to be able to take a "Test" class from any of the sites as an argument, but you can't dynamically change the argument type. What you need to do is make a base class called (say) AbstractTest in a "core" package shared by all applications: com L ronycorp L core L AbstractTest.cfc ...then have the Test component in each application extend AbstractTest: com L ronycorp L core L AbstractTest.cfc L app1 L App1Test.cfc L app2 L App2Test.cfc ... L appN L AppNTest.cfc In AppNTest.cfc: <cfcomponent extends="com.ronycorp.core.AbstractTest"> With this you can now rewrite your function without a dynamic class name: <cfargument type="com.ronycorp.core.AbstractTest"... Meaning that the argument has to be a "kind of" AbstractTest to be ok - this is taking advantage of polymorphism to stop your core code having to depend on a specific, concrete AppNTest class to work (you already tried this with the #app# idea, this is just a more conventional O-O way to do it). There is a name for this idea of having plugin classes that inherit from a common base class and implement things their own way: it's the "Template Method" design pattern. HTH, Robin ______________ Robin Hilliard Director - RocketBoots Pty Ltd Consulting . Recruitment . Software Licensing . Training http://www.rocketboots.com.au For schedule/availability call Pamela Higgins: w +61 7 5451 0362 m +61 419 677 151 f +61 3 9923 6261 e [EMAIL PROTECTED] or Direct: m +61 418 414 341 e [EMAIL PROTECTED] On 25/05/2007, at 6:01 PM, Rony wrote: > > Hey Andrew, > > Yes it does - IN MY APPLICATION. > > Our site has been designed so that the SAME name is used for the app > name, app folder, and the cf mapping. > > So if the app name is "cfaussie" then the mapping would be called > "cfaussie" and so would the folder that stores all the files. > > But my question was if the MAIN name changes to "cfaussie_local" this > would change the appname, cf mapping and the actual folder name. > > This is why i use the app name in the type.Obs this doesn't work. > > Sorry for any confusion. > > I was hoping for other way to do this... > > Thanks for your assistance, > > Much appreciated. > > On May 25, 4:34 pm, Andrew Scott <[EMAIL PROTECTED]> wrote: >> No it doesn't... >> >> Tell you why, the applicationname is relevant to the application >> being run. >> Which means that if you want to make this global to other >> applications you >> can't do that. Well you can, but CF won't allow it, so mappings >> are the only >> way to go or the root of the application. >> >> If it is in the root of the application then you do not need >> anything other >> than com.mystuff.package.component. >> >> But doing that will make maintenance a nightmare if you use it in >> more than >> application. So the best thing is to take it outside of the >> application and >> create a mapping to it. >> >> Andrew Scott >> Senior Coldfusion Developer >> Aegeon Pty. Ltd.www.aegeon.com.au >> Phone: +613 8676 4223 >> Mobile: 0404 998 273 >> >> -----Original Message----- >> From: cfaussie@googlegroups.com [mailto:[EMAIL PROTECTED] >> On Behalf >> >> Of Rony >> Sent: Friday, 25 May 2007 4:30 PM >> To: cfaussie >> Subject: [cfaussie] Re: CF Argument issues >> >> Hi Dale, >> >> The reason why i have this is because the mapping name is the same >> name as the application name and a fellow developer would like to be >> able to change the application name and create a new mapping with the >> app name, so i cannot hard code the app name when calling a >> component. >> >> hope this makes sense, > > > --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "cfaussie" group. To post to this group, send email to cfaussie@googlegroups.com To unsubscribe from this group, send email to [EMAIL PROTECTED] For more options, visit this group at http://groups.google.com/group/cfaussie?hl=en -~----------~----~----~----~------~----~------~--~---