You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lenya.apache.org by Christian Egli <ch...@wyona.net> on 2004/02/13 14:32:57 UTC

Re: cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/publication/file FilePublication.java

andreas@apache.org writes:

> andreas     2004/02/12 09:56:07
> 
>   Modified:    src/java/org/apache/lenya/cms/publication
>                         DublinCoreProxy.java DublinCoreImpl.java
>                         DublinCore.java
>                src/java/org/apache/lenya/cms/publication/file
>                         FilePublication.java
>   Log:
>   refreshing dublin core after coping a document
>   
>   Revision  Changes    Path
>   1.6       +2 -2      cocoon-lenya/src/java/org/apache/lenya/cms/publication/DublinCoreProxy.java
>   
>   Index: DublinCoreProxy.java
>   ===================================================================
>   RCS file: /home/cvs/cocoon-lenya/src/java/org/apache/lenya/cms/publication/DublinCoreProxy.java,v
>   retrieving revision 1.5
>   retrieving revision 1.6
>   diff -u -r1.5 -r1.6
>   --- DublinCoreProxy.java	2 Feb 2004 17:33:16 -0000	1.5
>   +++ DublinCoreProxy.java	12 Feb 2004 17:56:06 -0000	1.6
>   @@ -81,7 +81,7 @@
>         * @return a real dublin core object
>         * @throws DocumentException when an error occurs.
>         */
>   -    protected DublinCore instance() throws DocumentException {
>   +    public DublinCore instance() throws DocumentException {

Why did you change this? Is this really needed? The proxy is a simple
pattern from the GoF book and I think we should leave the visibility
of the instance() method as is.

How about adding a refresh() method to the proxy which simply relays
the refresh to the instance, i.e.

public void refresh() throws DocumentException {
    instance.refresh();
}

-- 
Christian Egli       christian.egli@wyona.com   +41 1 272 9161
                     Wyona AG, Hardstrasse 219, CH-8005 Zurich
Open Source CMS      http://www.wyona.org http://www.wyona.com 


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/publication/file FilePublication.java

Posted by Christian Egli <ch...@wyona.net>.
Andreas Hartmann <an...@apache.org> writes:

> Christian Egli wrote:
> 
> >>  -    protected DublinCore instance() throws DocumentException {
> >>  +    public DublinCore instance() throws DocumentException {
> > Why did you change this? Is this really needed? The proxy is a simple
> > pattern from the GoF book and I think we should leave the visibility
> > of the instance() method as is.
> 
> Actually, you're right ... My workaround is not good OO design
> at all. There's no real persistence layer for documents yet,
> I hope the repository will improve the situation.
> 
> > How about adding a refresh() method to the proxy which simply relays
> > the refresh to the instance, i.e.
> 
> I wouldn't like to add the refresh() method to the DublinCore
> interface. But maybe this hack is not as ugly as the hack that
> I checked in. It's OK with me to add refresh() to the proxy.

Ok, I'll add the refresh() method to the proxy and make the instance
protected again so that it'll correspond to the (GoF) Proxy Pattern
again.

-- 
Christian Egli       christian.egli@wyona.com   +41 1 272 9161
                     Wyona AG, Hardstrasse 219, CH-8005 Zurich
Open Source CMS      http://www.wyona.org http://www.wyona.com 


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org


Re: cvs commit: cocoon-lenya/src/java/org/apache/lenya/cms/publication/file FilePublication.java

Posted by Andreas Hartmann <an...@apache.org>.
Christian Egli wrote:

>>  -    protected DublinCore instance() throws DocumentException {
>>  +    public DublinCore instance() throws DocumentException {
> 
> 
> Why did you change this? Is this really needed? The proxy is a simple
> pattern from the GoF book and I think we should leave the visibility
> of the instance() method as is.

Actually, you're right ... My workaround is not good OO design
at all. There's no real persistence layer for documents yet,
I hope the repository will improve the situation.

> How about adding a refresh() method to the proxy which simply relays
> the refresh to the instance, i.e.

I wouldn't like to add the refresh() method to the DublinCore
interface. But maybe this hack is not as ugly as the hack that
I checked in. It's OK with me to add refresh() to the proxy.

-- Andreas


---------------------------------------------------------------------
To unsubscribe, e-mail: lenya-dev-unsubscribe@cocoon.apache.org
For additional commands, e-mail: lenya-dev-help@cocoon.apache.org