You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wink.apache.org by "Bryant Luk (JIRA)" <ji...@apache.org> on 2009/07/14 01:10:15 UTC
[jira] Created: (WINK-84) Classes returned from
getClasses/getSingletons can be a provider and a resource
Classes returned from getClasses/getSingletons can be a provider and a resource
-------------------------------------------------------------------------------
Key: WINK-84
URL: https://issues.apache.org/jira/browse/WINK-84
Project: Wink
Issue Type: Bug
Components: Common
Affects Versions: 0.1
Reporter: Bryant Luk
I don't think there was anything stopping classes returned from Application.getClasses() / getSingletons() to be both a resource and a provider besides coding style.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Updated: (WINK-84) Classes returned from
getClasses/getSingletons can be a provider and a resource
Posted by "Bryant Luk (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WINK-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryant Luk updated WINK-84:
---------------------------
Priority: Minor (was: Major)
As far as the default lifecycle, I don't know what would be the correct behavior. I was thinking more about any Scope cases and all the getSingletons() cases at the time.
Meant to make this minor since it's an edge case that I would hope no one would do this.
> Classes returned from getClasses/getSingletons can be a provider and a resource
> -------------------------------------------------------------------------------
>
> Key: WINK-84
> URL: https://issues.apache.org/jira/browse/WINK-84
> Project: Wink
> Issue Type: Bug
> Components: Common
> Affects Versions: 0.1
> Reporter: Bryant Luk
> Priority: Minor
>
> I don't think there was anything stopping classes returned from Application.getClasses() / getSingletons() to be both a resource and a provider besides coding style.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WINK-84) Classes returned from
getClasses/getSingletons can be a provider and a resource
Posted by "Michael Elman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WINK-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731310#action_12731310 ]
Michael Elman commented on WINK-84:
-----------------------------------
Currently we don't allow the class to be both a resource and a provider.
I think it's better to be strict to prevent strange bugs to appear later.
> Classes returned from getClasses/getSingletons can be a provider and a resource
> -------------------------------------------------------------------------------
>
> Key: WINK-84
> URL: https://issues.apache.org/jira/browse/WINK-84
> Project: Wink
> Issue Type: Bug
> Components: Common
> Affects Versions: 0.1
> Reporter: Bryant Luk
> Priority: Minor
>
> I don't think there was anything stopping classes returned from Application.getClasses() / getSingletons() to be both a resource and a provider besides coding style.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Resolved: (WINK-84) Classes returned from
getClasses/getSingletons can be a provider and a resource
Posted by "Bryant Luk (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WINK-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Bryant Luk resolved WINK-84.
----------------------------
Resolution: Won't Fix
Assignee: Bryant Luk
No one has complained or used this pattern (i.e. same class for resource and provider) so far. If you believe this issue should be fixed, please re-open and/or comment.
> Classes returned from getClasses/getSingletons can be a provider and a resource
> -------------------------------------------------------------------------------
>
> Key: WINK-84
> URL: https://issues.apache.org/jira/browse/WINK-84
> Project: Wink
> Issue Type: Bug
> Components: Common
> Affects Versions: 0.1
> Reporter: Bryant Luk
> Assignee: Bryant Luk
> Priority: Minor
>
> I don't think there was anything stopping classes returned from Application.getClasses() / getSingletons() to be both a resource and a provider besides coding style.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WINK-84) Classes returned from
getClasses/getSingletons can be a provider and a resource
Posted by "Nick Gallardo (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WINK-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12731500#action_12731500 ]
Nick Gallardo commented on WINK-84:
-----------------------------------
Someone came to me with that pattern the other day. I don't like it though, seems like janky way to reduce code.
This...
{code}
@Provider
@Produces("text/foo")
@Path("/foo")
public class MyHybrib implements MessageBodyReader, MessageBodyWriter {
@GET
@Produces("text/foo")
public String get() {}
public boolean isReadable()
public boolean isWriteable()
}
just doesn't seem right. In the case where it's a singleton, I would guess the lifecycle is the same and you're using the same object instance for both (business logic and provider gorp).
> Classes returned from getClasses/getSingletons can be a provider and a resource
> -------------------------------------------------------------------------------
>
> Key: WINK-84
> URL: https://issues.apache.org/jira/browse/WINK-84
> Project: Wink
> Issue Type: Bug
> Components: Common
> Affects Versions: 0.1
> Reporter: Bryant Luk
> Priority: Minor
>
> I don't think there was anything stopping classes returned from Application.getClasses() / getSingletons() to be both a resource and a provider besides coding style.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Commented: (WINK-84) Classes returned from
getClasses/getSingletons can be a provider and a resource
Posted by "Michael Elman (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WINK-84?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12730690#action_12730690 ]
Michael Elman commented on WINK-84:
-----------------------------------
There is at least one problem with this: by default resource and providers have different scopes - resources are created per request and providers are singletons.
What should happen for a class that is both resource and provider?
> Classes returned from getClasses/getSingletons can be a provider and a resource
> -------------------------------------------------------------------------------
>
> Key: WINK-84
> URL: https://issues.apache.org/jira/browse/WINK-84
> Project: Wink
> Issue Type: Bug
> Components: Common
> Affects Versions: 0.1
> Reporter: Bryant Luk
>
> I don't think there was anything stopping classes returned from Application.getClasses() / getSingletons() to be both a resource and a provider besides coding style.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.
[jira] Closed: (WINK-84) Classes returned from
getClasses/getSingletons can be a provider and a resource
Posted by "Mike Rheinheimer (JIRA)" <ji...@apache.org>.
[ https://issues.apache.org/jira/browse/WINK-84?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Mike Rheinheimer closed WINK-84.
--------------------------------
Issue is resolved. Closing per Bryant's approval to do so.
> Classes returned from getClasses/getSingletons can be a provider and a resource
> -------------------------------------------------------------------------------
>
> Key: WINK-84
> URL: https://issues.apache.org/jira/browse/WINK-84
> Project: Wink
> Issue Type: Bug
> Components: Common
> Affects Versions: 0.1
> Reporter: Bryant Luk
> Assignee: Bryant Luk
> Priority: Minor
>
> I don't think there was anything stopping classes returned from Application.getClasses() / getSingletons() to be both a resource and a provider besides coding style.
--
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.