You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@tapestry.apache.org by "Davor Hrg (JIRA)" <de...@tapestry.apache.org> on 2007/12/04 14:40:43 UTC

[jira] Created: (TAPESTRY-1958) aditional example for service decorators

aditional example for service decorators
----------------------------------------

                 Key: TAPESTRY-1958
                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1958
             Project: Tapestry
          Issue Type: Improvement
          Components: Documentation, tapestry-ioc
    Affects Versions: 5.0.6
            Reporter: Davor Hrg
             Fix For: 5.0.7


documentation for decorating services should have an additional example

somethig like this for situations where we are decorating a specific service,
and not using some general decorator factory

    public static ComponentMessagesSource decorateComponentMessagesSource(Object delegate, Logger logger){
        return new ComponentMessagesSourceDecorator((ComponentMessagesSource) delegate,logger);
    }

this should be documented because the decorator is ignored if above is chenged this way
(this is somehow more logical than above but doesn't work)


    public static ComponentMessagesSource decorateComponentMessagesSource(ComponentMessagesSource delegate, Logger logger){
        return new ComponentMessagesSourceDecorator(delegate,logger);
    }


I think that the second sample caused exceptions in earlier versions....
(the exception was even more misleading)

of course, if not too much trouble, tapestry ioc could be modified so that the second example works as well


-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


Re: [jira] Commented: (TAPESTRY-1958) aditional example for service decorators

Posted by Davor Hrg <hr...@gmail.com>.
I do need to decorate(not override) it to add extra behaviour for some
cases,
and delegate to orig service for the rest.

I'm currently building a ComponentMesasgeCatalog that can be updated on the
fly,
and also loaded from database (loading from db has it's drawbacks, but I
want it ....)

Davor Hrg

On Dec 5, 2007 11:21 PM, Massimo Lusetti (JIRA) <de...@tapestry.apache.org>
wrote:

>
>    [
> https://issues.apache.org/jira/browse/TAPESTRY-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548845]
>
> Massimo Lusetti commented on TAPESTRY-1958:
> -------------------------------------------
>
> Well it's me that didn't get the whole point, now i got more, sorry for
> the noise.
>
> One question, if you need to override the decorated service why you need
> it?
>
> > aditional example for service decorators
> > ----------------------------------------
> >
> >                 Key: TAPESTRY-1958
> >                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1958
> >             Project: Tapestry
> >          Issue Type: Improvement
> >          Components: Documentation, tapestry-ioc
> >    Affects Versions: 5.0.6
> >            Reporter: Davor Hrg
> >             Fix For: 5.0.7
> >
> >
> > documentation for decorating services should have an additional example
> > somethig like this for situations where we are decorating a specific
> service,
> > and not using some general decorator factory
> >     public static ComponentMessagesSource
> decorateComponentMessagesSource(Object delegate, Logger logger){
> >         return new
> ComponentMessagesSourceDecorator((ComponentMessagesSource) delegate,logger);
> >     }
> > this should be documented because the decorator is ignored if above is
> chenged this way
> > (this is somehow more logical than above but doesn't work)
> >     public static ComponentMessagesSource
> decorateComponentMessagesSource(ComponentMessagesSource delegate, Logger
> logger){
> >         return new ComponentMessagesSourceDecorator(delegate,logger);
> >     }
> > I think that the second sample caused exceptions in earlier versions....
> > (the exception was even more misleading)
> > of course, if not too much trouble, tapestry ioc could be modified so
> that the second example works as well
>
> --
> This message is automatically generated by JIRA.
> -
> You can reply to this email to add a comment to the issue online.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@tapestry.apache.org
> For additional commands, e-mail: dev-help@tapestry.apache.org
>
>

[jira] Commented: (TAPESTRY-1958) aditional example for service decorators

Posted by "Massimo Lusetti (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548845 ] 

Massimo Lusetti commented on TAPESTRY-1958:
-------------------------------------------

Well it's me that didn't get the whole point, now i got more, sorry for the noise.

One question, if you need to override the decorated service why you need it?

> aditional example for service decorators
> ----------------------------------------
>
>                 Key: TAPESTRY-1958
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1958
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Documentation, tapestry-ioc
>    Affects Versions: 5.0.6
>            Reporter: Davor Hrg
>             Fix For: 5.0.7
>
>
> documentation for decorating services should have an additional example
> somethig like this for situations where we are decorating a specific service,
> and not using some general decorator factory
>     public static ComponentMessagesSource decorateComponentMessagesSource(Object delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator((ComponentMessagesSource) delegate,logger);
>     }
> this should be documented because the decorator is ignored if above is chenged this way
> (this is somehow more logical than above but doesn't work)
>     public static ComponentMessagesSource decorateComponentMessagesSource(ComponentMessagesSource delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator(delegate,logger);
>     }
> I think that the second sample caused exceptions in earlier versions....
> (the exception was even more misleading)
> of course, if not too much trouble, tapestry ioc could be modified so that the second example works as well

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TAPESTRY-1958) aditional example for service decorators

Posted by "Massimo Lusetti (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548577 ] 

Massimo Lusetti commented on TAPESTRY-1958:
-------------------------------------------

If that's the case better to use something like this.

public static <T> T decorateTransaction(Class<T> serviceInterface, T delegate,
											String serviceId, Session session,
											TransactionDecorator decorator)
	{
		return decorator.build(serviceInterface, delegate, serviceId, session);
	}


We got generics so we can leverage the functionality and have type safety, otherwise we can go and use ruby ;)


> aditional example for service decorators
> ----------------------------------------
>
>                 Key: TAPESTRY-1958
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1958
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Documentation, tapestry-ioc
>    Affects Versions: 5.0.6
>            Reporter: Davor Hrg
>             Fix For: 5.0.7
>
>
> documentation for decorating services should have an additional example
> somethig like this for situations where we are decorating a specific service,
> and not using some general decorator factory
>     public static ComponentMessagesSource decorateComponentMessagesSource(Object delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator((ComponentMessagesSource) delegate,logger);
>     }
> this should be documented because the decorator is ignored if above is chenged this way
> (this is somehow more logical than above but doesn't work)
>     public static ComponentMessagesSource decorateComponentMessagesSource(ComponentMessagesSource delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator(delegate,logger);
>     }
> I think that the second sample caused exceptions in earlier versions....
> (the exception was even more misleading)
> of course, if not too much trouble, tapestry ioc could be modified so that the second example works as well

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Closed: (TAP5-185) aditional example for service decorators

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship closed TAP5-185.
-------------------------------------

    Resolution: Invalid

Your example now works; Tapestry recognizes Object.class or your service interface as representing the core service implementation.  This represents a previous change.

> aditional example for service decorators
> ----------------------------------------
>
>                 Key: TAP5-185
>                 URL: https://issues.apache.org/jira/browse/TAP5-185
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.0.15
>            Reporter: Davor Hrg
>            Assignee: Howard M. Lewis Ship
>            Priority: Minor
>
> documentation for decorating services should have an additional example
> somethig like this for situations where we are decorating a specific service,
> and not using some general decorator factory
>     public static ComponentMessagesSource decorateComponentMessagesSource(Object delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator((ComponentMessagesSource) delegate,logger);
>     }
> this should be documented because the decorator is ignored if above is chenged this way
> (this is somehow more logical than above but doesn't work)
>     public static ComponentMessagesSource decorateComponentMessagesSource(ComponentMessagesSource delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator(delegate,logger);
>     }
> I think that the second sample caused exceptions in earlier versions....
> (the exception was even more misleading)
> of course, if not too much trouble, tapestry ioc could be modified so that the second example works as well

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TAPESTRY-1958) aditional example for service decorators

Posted by "Davor Hrg (JIRA)" <de...@tapestry.apache.org>.
    [ https://issues.apache.org/jira/browse/TAPESTRY-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12548595 ] 

Davor Hrg commented on TAPESTRY-1958:
-------------------------------------

Am I missing something here,
that example is the same as from the docs...

My point is to add a working example for a situation where user
is overiding specific service with a specific handcoded decorator.
The usage in this case is to add a specific functionality and not intercepting
method calls for logging and transaction demarcation.


the example for general purpose decorator is in docs already (Logging decorator)



> aditional example for service decorators
> ----------------------------------------
>
>                 Key: TAPESTRY-1958
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1958
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Documentation, tapestry-ioc
>    Affects Versions: 5.0.6
>            Reporter: Davor Hrg
>             Fix For: 5.0.7
>
>
> documentation for decorating services should have an additional example
> somethig like this for situations where we are decorating a specific service,
> and not using some general decorator factory
>     public static ComponentMessagesSource decorateComponentMessagesSource(Object delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator((ComponentMessagesSource) delegate,logger);
>     }
> this should be documented because the decorator is ignored if above is chenged this way
> (this is somehow more logical than above but doesn't work)
>     public static ComponentMessagesSource decorateComponentMessagesSource(ComponentMessagesSource delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator(delegate,logger);
>     }
> I think that the second sample caused exceptions in earlier versions....
> (the exception was even more misleading)
> of course, if not too much trouble, tapestry ioc could be modified so that the second example works as well

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (TAPESTRY-1958) aditional example for service decorators

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAPESTRY-1958:
-------------------------------------------

    Fix Version/s:     (was: 5.0.7)
                   5.0.8

> aditional example for service decorators
> ----------------------------------------
>
>                 Key: TAPESTRY-1958
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1958
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Documentation, tapestry-ioc
>    Affects Versions: 5.0.6
>            Reporter: Davor Hrg
>             Fix For: 5.0.8
>
>
> documentation for decorating services should have an additional example
> somethig like this for situations where we are decorating a specific service,
> and not using some general decorator factory
>     public static ComponentMessagesSource decorateComponentMessagesSource(Object delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator((ComponentMessagesSource) delegate,logger);
>     }
> this should be documented because the decorator is ignored if above is chenged this way
> (this is somehow more logical than above but doesn't work)
>     public static ComponentMessagesSource decorateComponentMessagesSource(ComponentMessagesSource delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator(delegate,logger);
>     }
> I think that the second sample caused exceptions in earlier versions....
> (the exception was even more misleading)
> of course, if not too much trouble, tapestry ioc could be modified so that the second example works as well

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Commented: (TAP5-185) aditional example for service decorators

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
    [ https://issues.apache.org/jira/browse/TAP5-185?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12644340#action_12644340 ] 

Howard M. Lewis Ship commented on TAP5-185:
-------------------------------------------

Some aspects of decoration have changed since this issue was written and I may (may!) have improved the docs already.  I'll check.

> aditional example for service decorators
> ----------------------------------------
>
>                 Key: TAP5-185
>                 URL: https://issues.apache.org/jira/browse/TAP5-185
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.0.15
>            Reporter: Davor Hrg
>            Assignee: Howard M. Lewis Ship
>            Priority: Minor
>
> documentation for decorating services should have an additional example
> somethig like this for situations where we are decorating a specific service,
> and not using some general decorator factory
>     public static ComponentMessagesSource decorateComponentMessagesSource(Object delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator((ComponentMessagesSource) delegate,logger);
>     }
> this should be documented because the decorator is ignored if above is chenged this way
> (this is somehow more logical than above but doesn't work)
>     public static ComponentMessagesSource decorateComponentMessagesSource(ComponentMessagesSource delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator(delegate,logger);
>     }
> I think that the second sample caused exceptions in earlier versions....
> (the exception was even more misleading)
> of course, if not too much trouble, tapestry ioc could be modified so that the second example works as well

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Updated: (TAPESTRY-1958) aditional example for service decorators

Posted by "Howard M. Lewis Ship (JIRA)" <de...@tapestry.apache.org>.
     [ https://issues.apache.org/jira/browse/TAPESTRY-1958?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship updated TAPESTRY-1958:
-------------------------------------------

    Priority: Minor  (was: Major)

> aditional example for service decorators
> ----------------------------------------
>
>                 Key: TAPESTRY-1958
>                 URL: https://issues.apache.org/jira/browse/TAPESTRY-1958
>             Project: Tapestry
>          Issue Type: Improvement
>          Components: Documentation, tapestry-ioc
>    Affects Versions: 5.0.6
>            Reporter: Davor Hrg
>            Priority: Minor
>
> documentation for decorating services should have an additional example
> somethig like this for situations where we are decorating a specific service,
> and not using some general decorator factory
>     public static ComponentMessagesSource decorateComponentMessagesSource(Object delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator((ComponentMessagesSource) delegate,logger);
>     }
> this should be documented because the decorator is ignored if above is chenged this way
> (this is somehow more logical than above but doesn't work)
>     public static ComponentMessagesSource decorateComponentMessagesSource(ComponentMessagesSource delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator(delegate,logger);
>     }
> I think that the second sample caused exceptions in earlier versions....
> (the exception was even more misleading)
> of course, if not too much trouble, tapestry ioc could be modified so that the second example works as well

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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


[jira] Assigned: (TAP5-185) aditional example for service decorators

Posted by "Howard M. Lewis Ship (JIRA)" <ji...@apache.org>.
     [ https://issues.apache.org/jira/browse/TAP5-185?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Howard M. Lewis Ship reassigned TAP5-185:
-----------------------------------------

    Assignee: Howard M. Lewis Ship

> aditional example for service decorators
> ----------------------------------------
>
>                 Key: TAP5-185
>                 URL: https://issues.apache.org/jira/browse/TAP5-185
>             Project: Tapestry 5
>          Issue Type: Improvement
>    Affects Versions: 5.0.15
>            Reporter: Davor Hrg
>            Assignee: Howard M. Lewis Ship
>            Priority: Minor
>
> documentation for decorating services should have an additional example
> somethig like this for situations where we are decorating a specific service,
> and not using some general decorator factory
>     public static ComponentMessagesSource decorateComponentMessagesSource(Object delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator((ComponentMessagesSource) delegate,logger);
>     }
> this should be documented because the decorator is ignored if above is chenged this way
> (this is somehow more logical than above but doesn't work)
>     public static ComponentMessagesSource decorateComponentMessagesSource(ComponentMessagesSource delegate, Logger logger){
>         return new ComponentMessagesSourceDecorator(delegate,logger);
>     }
> I think that the second sample caused exceptions in earlier versions....
> (the exception was even more misleading)
> of course, if not too much trouble, tapestry ioc could be modified so that the second example works as well

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


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