The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
Structure of a Borges Application

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
David Naseby

Posts: 40
Nickname: naseby
Registered: Jun, 2004

David Naseby is a coder from Sydney, who codes in Ruby far too much yet not nearly enough.
Structure of a Borges Application Posted: Jun 8, 2004 7:04 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by David Naseby.
Original Post: Structure of a Borges Application
Feed Title: naseby + ruby + stuff
Feed URL: http://homepages.ihug.com.au/~naseby/rss.xml
Feed Description: Random wanderings through Ruby.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by David Naseby
Latest Posts From naseby + ruby + stuff

Advertisement

I’ve been wondering about the shape of a Borges application. The best example that comes with the distro is SushiNet, so I cracked it open and had a peek.

The highest level description of the application flow in SushiNet is in SushiNet::StoreTask, which is a subclass of Borges::TaskFrame. The application flow is described in the #go method of the task frame, and this is also where the whole application is registered with register_application 'store', SushiNet::StoreSession. Control is shuffled to other controllers with the #call method.

After reading on a bit, and abandoning my stream of consciousness for a few minutes, and then jumping across to the Seaside version, its pretty clear that the Borges sample is not quite up to the same state of development as the Squeak version. This is to be expected, of course. The shape of the two are however, comparable, and the naming conventions are the same, so I can better understand the Squeak code with reference to the Ruby. Compare the Ruby SushiNet::StoreTask#go:

  def go
    browse

    until checkout_successful do
      browse
    end

    say_goodbye
  end

with the Squeak:


go | shipping billing creditCard | cart _ WAStoreCart new. self session isolate: [[self fillCart. self confirmContentsOfCart] whileFalse]. self session isolate: [shipping _ self getShippingAddress. billing _ (self useAsBillingAddress: shipping) ifFalse: [self getBillingAddress] ifTrue: [shipping]. creditCard _ self getPaymentInfo. self shipTo: shipping billTo: billing payWith: creditCard]. self displayConfirmation.

Obviously, the second isolate, picking up the billing details, isn’t yet implemented. More later. Sleep now.

Update: the permalink wasn’t working. I don’t think I’ve quite ironed out all of the kinks in my blogware..

Read: Structure of a Borges Application

Topic: Ruby 1.8.1 ri Data Files Previous Topic   Next Topic Topic: My next project

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use