Thanks for the tip. I ddn't realise that the type of a cfc was inherited when using extends, I always thought that the top level component was the only type I could use.
Extending an abstract dao worked fine but is it possible to to the same with a reactor generated dao? If not, using a type of web-inf.cftags.component would probably be my best bet. On 3/25/06, Jared Rypka-Hauer <[EMAIL PROTECTED]> wrote: > You can, since it's the default for the extends attribute where none is > specified, use web-inf.cftags.component as the value of an argument="" > attribute and at least insure that you're passing in an object. > > It's not as intricate as creating a parent DAO but it does guarantee your > type checking is better than any. It basically means "any object" as opposed > to "anything possible". Inheritance isn't a bad thing if you need need it, > but may not be necessary, especially if all the methods in the DAO are > unique to that DAO -- you really don't need to bother extending an object > unless there's at least one method that doesn't change from parent to child. > > I.e.: <cfargument name="someDao" type="web-inf.cftags.component" > required="true" /> > > > > > > Just one more tool in the toolbox. > > > > > J > > ------------------------------------------------ > > Jared C. Rypka-Hauer > > Continuum Media Group LLC > > http://www.web-relevant.com > > Member, Team Macromedia - ColdFusion > > > > > "That which does not kill me makes me stranger." - Yonah Schmeidler > > > On Mar 24, 2006, at 7:23 PM, Peter J. Farrell wrote: > > Chris Scott said the following on 3/24/2006 7:13 PM: > Instead of changing the type to 'any' for your argument for > setNewsDAO, why don't you make a mock abstract class for your newDAO, > and then have both your newsDAO and newsDAO_XML extend the same class. > Then you can have that base abstract class be the type for your > argument. A good thing to do with interfaces by the way, which of > course ARE coming! > > -Chris > I ditto this as well. I switched to always extending my DAOs and > Gateways with a base class specific to the entity the DAO/Gateway > represents last fall. This was due to the fact that we use MySQL around > here, there is a possibility of making one of our apps support other DBs. > > .Peter > > P.s. Rock on Team Fusion ;-) > > -- > Peter J. Farrell :: Maestro Publishing > Member Team Mach-II :: Member Team Fusion > http://blog.maestropublishing.com > > Create boilerplate beans and transfer objects for ColdFusion! > Fire up a cup of Rooibos! > http://rooibos.maestropublishing.com/ > > > > >
