cocoon-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Leo Sutic" <leo.su...@inspireinfrastructure.com>
Subject RE: [Kernel2.2] Comments
Date Wed, 31 Mar 2004 12:42:29 GMT


> From: Pier Fumagalli [mailto:pier@betaversion.org] 
>
> > Some quick observations:
> >
> >  1. @author <a href="http://www.vnunet.com/">VNU Business
> > Publications</a>
> >     Is this OK with Apache and VNU?
> 
> Defintely OK with VNU (if someone visits our site because of a click
on 
> the JavaDOC, and then come back, we got one more customer... If you 
> guys don't want to see it in there, you can remove it no 
> problems... It is in my default Java class template.

I have absolutely no problems with this. Just wondered if it had been
left in accidentally.

> >  2. Wire.java
> >     /**
> >      * <p>Check wether the wire between this {@link 
> Wirings} instance
> > and the
> >      * original component is still active.</p>
> >      *
> >      * <p>When this method returns <b>true</b> all methods 
> called on 
> > this
> >      * instance will be forwarded to the original component 
> instance 
> > associated
> >      * with this wire.</p>
> >
> >     You cannot guarantee that. The instance may be 
> redeployed between
> > the call
> >     to wired() and the next call.
> >
> >     No point in having a method whose return value means nothing.
> 
> This method will return true until the block instance will not be 
> destroyed or replaced by the Deployer, and when this method returns 
> false, whoever got this wire should release it and acquire a new one 
> (which will be got from the new block instance).
> 
> Rember? The idea is never to completely remove blocks until 
> forced to, so the Wire instance will still work even if wired()
returns 
> false. The wire will only be deactivated by either a call to release()
or 
> dispose() or by a forceful destruction by the deployer.

I'd still like this to be transparent...

Having a coding convention that requires you to do wired() checks
before every call is bad in my opinion.

What you can do is have an:

    Wire.ensureWired()

which will do:

    if (!wired()) {
        // renew proxy target
    }

Then the client can call the method before it starts processing. I.e.
the client notifies the framework that "if you want to drop this
instance,
now is a good time".

> Yes, each component instance has only one contextualized wire, because

> that instance is its own wire as it is returned to the caller. The 
> JavaDOC goes in quite a lot of details on why this is done, and
provide 
> some examples.

OK, will check.

> >  5. Configuration.java
> >
> >     public class Configuration extends ArrayList
> >
> >     I'd use composition instead...
> 
> ??? extends AbstractList ???

No, I meant:

    public class Configuration {

        private final List nodes = new ArrayList();

        ...
    }


> >  6. Parameters.java
> >
> >     Get rid of this one. Why can't components accept a hierarchy of
> >     configuration nodes as configuration data?
> 
> No... Parameters are typed and the framework checks the type of each 
> parameter. One of the parameters CAN be a configuration on the other 
> hand if in its descriptor the block requires:

Missed that. Thanks!

> >  9. Identifier.java
> >
> >     * 
> > <p><code>protocol://location/path/major.minor(.revision)?</code></p>
> >
> >     Does this mean that all Blocks are automatically mapped into a
URL 
> > space?
> 
> All blocks have a unique identifier. And this list agreed that each 
> block identifier will assume the requirements specified in the 
> Identifier interface.

Yes, I'm with you so far. But what does the URL really signify? What if
I put the URL into my web browser? Will I download the block? Or?

/LS


Mime
View raw message