Discussion:
noob question on modleing and requests
Caleb Buxton
2013-11-26 01:23:24 UTC
Permalink
Hi,

I'm trying to create a new provider using fog. Rather than use tokens like
with AWS you need to negotiate a session and retain and reuse a session id.

I'd like to create a #create_session request, and a Session model.

Should #create_session depend on a Session model instance, and modify it
with the new session id when successful?
OR
Should #create_session depend on the dependencies for obtaining a Session,
and return a new Session instance.

Is returning/modifying Session instances the responsibility of the Parsers
or the Collections?

Cheers,
Caleb
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
geemus (Wesley Beary)
2013-11-26 02:13:00 UTC
Permalink
Good questions.

Would the end user ever need to interact directly with the session?

If it is used only under the covers I think you could skip over some of
these details and just hide it under the covers in whatever way would be
convenient. Then the related session data could just be stored in the
connection and passed down through collection/models similar to how it
works for other providers.

Does that help/make sense? I'm certainly happy to discuss further.

Thanks,
wes
Post by Caleb Buxton
Hi,
I'm trying to create a new provider using fog. Rather than use tokens like
with AWS you need to negotiate a session and retain and reuse a session id.
I'd like to create a #create_session request, and a Session model.
Should #create_session depend on a Session model instance, and modify it
with the new session id when successful?
OR
Should #create_session depend on the dependencies for obtaining a Session,
and return a new Session instance.
Is returning/modifying Session instances the responsibility of the Parsers
or the Collections?
Cheers,
Caleb
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Caleb Buxton
2013-11-26 05:53:14 UTC
Permalink
Thanks Wes,

Cool. I just checked out the rackspace decomposition. You call it
#create_token because you want the token out of the request, rather than
the creation of a "session" entity. Shouldn't have jumped to the conclusion
that models are the only things allowed to use your request pattern.

In the meantime, I took a look at
https://github.com/fog/fog/blob/master/tests/aws/requests/storage/object_tests.rb
and have only so far committed code to the request.

Much appreciated,
Caleb
Post by geemus (Wesley Beary)
Good questions.
Would the end user ever need to interact directly with the session?
If it is used only under the covers I think you could skip over some of
these details and just hide it under the covers in whatever way would be
convenient. Then the related session data could just be stored in the
connection and passed down through collection/models similar to how it
works for other providers.
Does that help/make sense? I'm certainly happy to discuss further.
Thanks,
wes
Post by Caleb Buxton
Hi,
I'm trying to create a new provider using fog. Rather than use tokens
like with AWS you need to negotiate a session and retain and reuse a
session id.
I'd like to create a #create_session request, and a Session model.
Should #create_session depend on a Session model instance, and modify it
with the new session id when successful?
OR
Should #create_session depend on the dependencies for obtaining a
Session, and return a new Session instance.
Is returning/modifying Session instances the responsibility of the
Parsers or the Collections?
Cheers,
Caleb
--
You received this message because you are subscribed to the Google Groups
"ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
geemus (Wesley Beary)
2013-11-26 14:37:13 UTC
Permalink
Sounds good. Hopefully that will help you keep it a bit simpler as you get
started. Just let me know if you have further questions or anything I can
help with.
Post by Caleb Buxton
Thanks Wes,
Cool. I just checked out the rackspace decomposition. You call it
#create_token because you want the token out of the request, rather than
the creation of a "session" entity. Shouldn't have jumped to the conclusion
that models are the only things allowed to use your request pattern.
In the meantime, I took a look at
https://github.com/fog/fog/blob/master/tests/aws/requests/storage/object_tests.rband have only so far committed code to the request.
Much appreciated,
Caleb
Post by geemus (Wesley Beary)
Good questions.
Would the end user ever need to interact directly with the session?
If it is used only under the covers I think you could skip over some of
these details and just hide it under the covers in whatever way would be
convenient. Then the related session data could just be stored in the
connection and passed down through collection/models similar to how it
works for other providers.
Does that help/make sense? I'm certainly happy to discuss further.
Thanks,
wes
Post by Caleb Buxton
Hi,
I'm trying to create a new provider using fog. Rather than use tokens
like with AWS you need to negotiate a session and retain and reuse a
session id.
I'd like to create a #create_session request, and a Session model.
Should #create_session depend on a Session model instance, and modify it
with the new session id when successful?
OR
Should #create_session depend on the dependencies for obtaining a
Session, and return a new Session instance.
Is returning/modifying Session instances the responsibility of the
Parsers or the Collections?
Cheers,
Caleb
--
You received this message because you are subscribed to the Google
Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an
For more options, visit https://groups.google.com/groups/opt_out.
--
You received this message because you are subscribed to the Google Groups "ruby-fog" group.
To unsubscribe from this group and stop receiving emails from it, send an email to ruby-fog+unsubscribe-/JYPxA39Uh5TLH3MbocFF+G/***@public.gmane.org
For more options, visit https://groups.google.com/groups/opt_out.
Loading...