Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.ruby > #2380

Re: Seeking advice

From Robert Klemme <shortcutter@googlemail.com>
Newsgroups comp.lang.ruby
Subject Re: Seeking advice
Date 2011-04-06 04:30 -0500
Organization Service de news de lacave.net
Message-ID <BANLkTimUDUnF1200K04uDp_zQAYv-xtopw@mail.gmail.com> (permalink)
References <a5c155d833135cc1cccec3cf894380c8@ruby-forum.com> <b28cf1e7707e7c222bf1086109e644f5@ruby-forum.com>

Show all headers | View raw


On Tue, Apr 5, 2011 at 8:30 PM, Alex Rothbard <alex323@gmail.com> wrote:
> The factory design pattern is sort of what I want, but not exactly.
> Remember that there are three different classes (services) that need to
> take advantage of a transport. The library is broken down like this:

I'm not convinced we are actually that far away from what you want.

> There is a high level class that represents a user's overall account.
> The user uses this class only. This account class needs to access three
> different "services" (classes): the grid, the archive, and the
> transaction service. All three services need to communicate with the
> remote server using a transport.

Do all three services need their own implementation of each transport
(i.e. thrift for grid, thrift for archive, thrift for TX) or do you
only need / want a single transport implementation per service?

> In the example above, the transport is providing methods for accessing
> the grid, but I am thinking of it in another way: the

Well, that's just a name.  You can replace it by "connection". :-)

> grid/archive/transaction classes should provide methods which correspond
> to the API on the remote server, and those classes then use the selected
> transport to send it across.
>
> In short, I have a server library which offers up three sets of APIs
> (one for each service), and I want to be able to allow the end user to
> easily choose which transport the client library uses when accessing
> these services.

It would be important to know when the user must decide about the
transport.  Do you want to have him do it initially when he opens his
account?  Do you want to allow for later changes of the transport?  Or
do you even want to use a different transport per interaction?  Also,
how do you want your transports to work: should they be connection
oriented or message oriented?  This will determine whether you need
something like a connection object you must store somewhere.

Kind regards

robert

-- 
remember.guy do |as, often| as.you_can - without end
http://blog.rubybestpractices.com/

Back to comp.lang.ruby | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

Seeking advice Alex Rothbard <alex323@gmail.com> - 2011-04-05 08:22 -0500
  Re: Seeking advice Robert Klemme <shortcutter@googlemail.com> - 2011-04-05 08:39 -0500
    Re: Seeking advice Johnny Morrice <spoon@killersmurf.com> - 2011-04-05 09:44 -0500
      Re: Seeking advice Robert Klemme <shortcutter@googlemail.com> - 2011-04-05 10:23 -0500
  Re: Seeking advice Johnny Morrice <spoon@killersmurf.com> - 2011-04-05 08:43 -0500
  Re: Seeking advice Alex Rothbard <alex323@gmail.com> - 2011-04-05 13:30 -0500
    Re: Seeking advice Jesús Gabriel y Galán <jgabrielygalan@gmail.com> - 2011-04-06 01:53 -0500
    Re: Seeking advice Robert Klemme <shortcutter@googlemail.com> - 2011-04-06 04:30 -0500

csiph-web