sorry, s/rc/rf/

RequestFactory doesn't have create anymore, neither does Request,
which is the problem.

I'm more than fine with RequestFactory not having it because it gives
the impression your objects are application scope instead of request
scope.  But without create on Request, we don't have a good way of
doing this

On Sat, Oct 2, 2010 at 4:52 PM, Patrick Julien <[email protected]> wrote:
> On Sat, Oct 2, 2010 at 4:41 PM, BobV <[email protected]> wrote:
>> On Sat, Oct 2, 2010 at 1:56 PM, Patrick Julien <[email protected]> wrote:
>>> This assumes that the built in persist method works for everyone and
>>> it really, really doesn't.  Now we have a serious chicken and egg
>>> problem because our persist methods take the form:
>>>
>>> record persist(credentials, record);
>>>
>>> but now we can't create a record until after we've called persist from
>>> the RequestContext interface
>>
>> I'm assuming from your message that the persist method above is an
>> instance method on your Record domain type.  If it's not, just change
>> InstanceRequest to Request and drop the using() call.
>
> It's not, it's a method, non-static, of service object.
>
>
>>
>> interface RecordService extends RequestContext {
>>  // < instance type, return type >
>>  InstanceRequest<RecordProxy, RecordProxy> persist(CredentialsProxy
>> credentials, RecordProxy record);
>> }
>>
>> interface MyFactory extends RequestFactory {
>>  RecordService recordService();
>> }
>>
>> RecordService svc = rf.recordService();
>> RecordProxy record = rf.create(RecordProxy.class);
>> CredentialsProxy cred = rf.create(CredentialsProxy.class);
>> svc.persist(cred, record).using(record).to(new Receiver()).fire();
>>
>>
>
> That doesn't work because rc.create() is gone.  Otherwise, yeah, it's great
>

-- 
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to