> From: news [mailto:[EMAIL PROTECTED] On Behalf Of Leo Simons
> 
> Leo Sutic wrote:
> > +0.1 I ***hate*** client-side validation of container contracts.
> 
> yup. You're thinking of the TransientFactory as provided by the 
> container. If you see it as provided as a component 

OK, then it makes sense.

> Note it's optional here, too (client is not required to 
> call provides()).
 
Can't believe I missed that. Change vote to +0.9.

> > +0.5 I ***hate*** client-side validation of container contracts, but
> > at least it is optional here.
> 
> yup. I just hate pooling :D. Does anyone know of any programming 
> language or framework or application where it is less ugly?

Java 1.5 with generics.

    // Bastardized C++/Java mix because I'm too lazy to look up
    // the correct syntax.
    template< typename T >
    interface TransientFactory {
        T get ();
        void put (T object);
    }

    TransientFactory<MyComponent> factory = ...;

    MyComponent comp = factory.get (); // No cast, typesafe.

> >>did you ever get the metadata for an argument-by-name association
> >>working properly?
> > 
> > What? Like the example above? Sure.
> 
> yep. Is it in commons-attributes? 

Yes.

I recommend that you checkout from cvs and compile. I've added some
convenience functions and some other small good things since last.

Shameless plug: It even has named parameters!

    /**
     * @@Dependency(optional=true)
     */

(Realized via JavaBean setters and a seal() method to make the attribute
immutable.)

> I'd like to see how you made it 
> happen...I made the choice not to use attributes 'till 1.5, but I'm 
> still interested how for things can be streched....practical 
> magic is a 
> hobby of mine :D
> 
> >      * @@.return MyAttribute ()
> 
> do you have use case for that as well? Can't think of any.

Just for completeness.
 
/LS


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to