Re: [picocontainer-dev] Swing MVC example app

Paul Hammant <[email protected]>
Newsgroups gmane.comp.java.picocontainer.devel
Message-ID <[email protected]>
Mike,

> This is a great example to have around!

:-)

>
>
> One minor question that I had (style-wise): what would be the  
> "standard" way of
> constructing a new PicoContainer?
>
> You have:
> DefaultPicoContainer pico = new DefaultPicoContainer(new  
> Caching().wrap(new
> ConstructorInjection()));
>
>
> While I noticed that I tend to use (since 2.0) for typical  
> construction:
> MutablePicoContainer pico = new
> PicoBuilder().withCaching().withLifecycle().build();
>

That's a good point.  Maybe the PicoBuilder is idiomatic for 2.0.

> Either is fine, but since Pico newbies will tend to set their  
> behavior in stone
> once they see the setup, I figured this would be a good chance to  
> figure out a
> "typical usage pattern".

Incidentally,  The TestabilityMetrics thing scores PicoBuilder as one  
of our 'least good' classes in terms of ease for us to test it.  Borne  
out I guess by that stupid XML/dsl thing I did for it.

   Analyzed classes :   153
  Excellent classes :   150  98.0%
       Good classes :     2   1.3%
Needs work classes :     1   0.7%
Highest Cost

org.picocontainer.paranamer.BytecodeReadingParanamer 124
org.picocontainer.PicoBuilder 62
org.picocontainer.paranamer.BytecodeReadingParanamer$ClassReader 56
org.picocontainer.behaviors.PropertyApplicator 48
org.picocontainer.paranamer.BytecodeReadingParanamer$TypeCollector 42
org.picocontainer.parameters.BasicComponentParameter 36
org.picocontainer.DefaultPicoContainer 34
org.picocontainer.injectors.ConstructorInjector 29
org.picocontainer.paranamer.DefaultParanamer 28
org.picocontainer.paranamer.BytecodeReadingParanamer$Type 26
org.picocontainer.injectors.AdaptingInjection 24
org.picocontainer.parameters.CollectionComponentParameter 23
org.picocontainer.injectors.IterativeInjector 19
org.picocontainer.injectors.SingleMemberInjector 17
org.picocontainer.DefaultPicoContainer$AsPropertiesPicoContainer 15
org.picocontainer.injectors.IterativeInjector$2 15
org.picocontainer.injectors.AnnotatedFieldInjection 14
org.picocontainer.injectors.ConstructorInjection 14
org.picocontainer.injectors.MethodInjection 14
org.picocontainer.injectors.MultiInjection 14
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.