It shouldn't effect parent/child right? That would defeat the purpose? I would think though that we would want to throw an error if the same id was used in the local factory. Weren't we already doing that, did that somehow disappear and we never noticed?

Chris

Chris Scott
[EMAIL PROTECTED]
http://cdscott.blogspot.com/
http://www.coldspringframework.org/


GIF image







On Jul 10, 2006, at 9:43 PM, Dave Ross wrote:

hmm... I was really thinking that this was only if the same id was
used twice in a single xml file (or whatever is passed to the
loadBeans() methods). So that wouldn't affect you, right?

-Dave

On 7/10/06, Joe Rinehart <[EMAIL PROTECTED]> wrote:
Dave,

Is it going to throw an error?  I'll need to shift a bit of code in
MG, but it really should use parent/child anyhow.

-Joe

On 7/10/06, Dave Ross <[EMAIL PROTECTED]> wrote:
> Jon,
>
> Sounds reasonable - I'll just need to make sure that this doesn't
> affect the hiearchical bean factory features, because by design you
> *can* define the same bean in the parent and child factories (the
> child bean would override/take precedence).
>
> thanks,
>
> Dave
>
> On 7/10/06, Jon Gunnip <[EMAIL PROTECTED]> wrote:
> > Hi,
> >
> > I just spent some time tracking down an error in CS where it turned out I > > had defined the same bean twice (due to copying and pasting some similar xml > > snippets). It would be helpful if CS had alerted me to this issue. Any > > reason why it shouldn't? Add the following code to loadBeanDefinitions() in
> > DefaultXMLBeanFactory may to it.
> >
> > on line 128 in v1.0:
> > <cfset var beansFound = "" >
> >
> > on line 156 in v1.0:
> > <cfif structKeyExists( beansFound, beanAttributes.id )>
> >  <cfthrow type="coldspring.DuplicateBeanDefinitionException"
> > message="bean with id #beanAttributes.id# defined multiple times" >
> > </cfif>
> > <cfset beansFound[beanAttributes.id] = 1 >
> >
> > This maybe a naive approach since I don't fully understand the CS code.
> > Jon
> >
> >
> >
> >
>
>


--
Get Glued!
The Model-Glue ColdFusion Framework
http://www.model-glue.com




Reply via email to