users@jersey.java.net

Re: Is there any way to programmatically set the _at_Path ?

From: Chris Carrier <ctcarrier_at_gmail.com>
Date: Wed, 10 Nov 2010 10:47:47 -0800

We created a CRUD framework using generics that kind of accomplishes
what you want. Any new resource that needs normal CRUD functionality
all we need to do is create the JPA annotated model class and then
create an endpoint implementation that extends our abstract framework.
 All the logic is inherited like DB stuff, paging, validation etc...
Not quite as light as you are talking but it's an option. For us
having concrete endpoint implementations has some other advantages
like gathering metrics and testing etc.

Chris

On Wed, Nov 10, 2010 at 10:41 AM, Gary Moore <gary.moore_at_gmail.com> wrote:
>>Basically would allow deploying same web app, but with slightly different configurations.
>
> ^^This is close to our idea.  We were researching genericizing one
> RESTful resource class that can handle many objects.
>
> Say we have a RecordResource that does the usual CRUD operations on a
> model named "Books" using GET, PUT, POST, and DELETE.  Management
> comes along and says "Now we need to CRUD "Authors""!!!  It would be
> pretty awesome if we could just repurpose that RecordResource to CRUD
> Authors and save us the time of re-writing a lot of what we've already
> written.  Was thinking that we could parse a props file, then in
> PackagesResourceConfig just instantiate a RecordsResource with an
> injected path value for each entry in the props file.
>
> Hopefully that's clear.  If you have questions please fire back.
>
> Thanks all.
>
> Gary
>
> On Wed, Nov 10, 2010 at 1:31 PM, Tatu Saloranta <tsaloranta_at_gmail.com> wrote:
>> I suspect it's more of deployment-time thing; maybe some configuration
>> settings (properties file, system properties) might be used to change
>> some paths?
>> I could see why externalizing some path settings makes sense.
>> Basically would allow deploying same web app, but with slightly
>> different configurations.
>>
>> -+ Tatu +-
>>
>> On Wed, Nov 10, 2010 at 10:11 AM, Clint Combs <clint_at_ccombs.net> wrote:
>>> What's your use case?  Why do you need to modify the @Path value at
>>> run-time?
>>> -Clint
>>> On Wed, Nov 10, 2010 at 10:32 AM, Gary Moore <gary.moore_at_gmail.com> wrote:
>>>>
>>>> Hi All,
>>>>
>>>> I want the @Path value injected at compile or run time.  Is there a
>>>> way to do this?
>>>>
>>>> Thanks,
>>>> Gary
>>>>
>>>> --
>>>> Gary Moore
>>>> http://www.gmoore.net
>>>
>>>
>>>
>>>
>>>
>>
>
>
>
> --
> Gary Moore
> http://www.gmoore.net
>