Showing posts with label Rails. Show all posts
Showing posts with label Rails. Show all posts

Monday, April 20, 2009

Cash Transactions : Care Continuity

In programming major applications such as finance there is a need to ensure within the transactions and the database operations that mistakes do not occur.

The classic example is a transfer between two accounts:
def transfer(from, to, amount)
from.debit(amount)
to.credit(amount)
end
It is vital that the above method (example provided by Tate and Hibbs) does not fail after the debit. In Rails the transaction method help to prevent 'digital accidents' as follows:
def transfer(from, to, amount)
Account.transaction do
from.debit(amount)
to.credit(amount)
end
end
transaction is itself a method built into Rail's Active Record that helps to maintain the integrity of transactions. Which brings me to 'care'. ...

There are several blog posts here since you reach a stage in your career when the hard fought lessons of yesteryear have to be faced again but this time like after dinner wind.
There are many possible care transactions that arise.

Many have a specific context and frequently these are conjoined:
  • timing
  • relationships - trust
  • responsibility - transfer
  • care environment
  • record (paper, electronic)
As to care transaction consider these:
def transfer(from, to, care_plan)
Care.transaction do
from.hospital(care_plan)
to.community(care_plan)
end
end

def transfer(from, to, day_care)
Care.transaction do
from.home(day_care)
to.day_center(day_care)
end
end
Wherever, whenever, whatever and whoever your transactions involve, take care of them and remember in health and social care (esp.) outcomes add up.

Don't forget to look after the however: the information, the knowledge, the promises ....
def transfer(from, to, promise_plan_of_action)
Care.transaction do
from.nurse(promise_plan_of_action)
to.carer(promise_plan_of_action)
end
end
Reference: Bruce Tate, Curt Hibbs (2006) Ruby on Rails: Up and Running, O'Reilly, p.35.

Tuesday, March 31, 2009

Scotland on Rails 2009

1 April mmm... while it is not yet self evident I should by now have an all singing and dancing website. In fact maybe I should have two, since the conference score is currently:

DRUPAL :1 (Drupalcon Szeged 2008) Ruby and Rails :2 (Scotland on Rails 2008 & 2009)

Having just returned from Edinburgh and three days of presentation magic - not only were the speakers experts and leaders they all knew how to present - it's time for me to reflect a little.

Jim WeirichI took something away from ALL the presentations as I attended 'a full stream' mostly the sessions in the main hall. Jim Weirich's session on Building Blocks of Modularity was very interesting informatically, holistically and clinically as he explained and referenced “connascence”:

An examination of the concept of “connascence” and building modular programs.

Connascence: n.
* The common birth of two or more at the same time; production of two or more together.
* That which is born or produced with another.
* The act of growing together.


Connascence: undoubtedly a concept to add to 'consilience'.

Whether using Drupal or Ruby - Rails I'm conscious that you can create a website very quickly. As already ack. here last summer in Hungary Dan and James advised that I get something together and publish the beta. On Saturday Steven A Bristol stressed the same:
  1. Identify the essential thing you have to offer through a website / application;
  2. do not wait until it is 'finished';
  3. - speaking of which are you a techie or designer? Find the partner(s) you need, people are rarely both;
  4. ensure you include a feedback mechanism - not just e-mail;
  5. and 'get it out there'.
In their session Kevin McDonagh and Joseph Wright added that it is a waste of time appealing to the World. Of course Kevin did not realise how painful it was for me to hear that, but since this is certainly true - I have appealed to the world - it was very therapeutic. Unlike Kevin and Joseph's Green Map as a Community Project I'm not sure if whether I can appeal to the local community (despite an interest in ecology).

Dave Thomas of the Pragmatic Programmers by Fraser Spiers at SoR 2009Like Drupal the Ruby community is just a terrific group of people - welcoming, supportive, cohesive - a bunch of real humans. The charity tutorial day raised £7,000 for CHAS the Children’s Hospice Association Scotland.

After Dave Thomas presented a fascinating keynote on the Ruby Object Model, Erin Staniland and Tim Harding confirmed I've the basic building blocks in place to create and execute a Rails application on my MacBook.

Peter Jones at SoR March 2009 image by Fraser SpeirsI am hooked on Drupal and Ruby. Some of the keywords and structures in Ruby are dangerous in their appeal - more on this to follow...

Driving (ironically) back to NW England I realised Earth Hour was in progress, hopefully there will be another one. That night Orion was beautiful chasing a fresh smiling new moon along the way...

Images: thanks to SoR site and Fraser Spiers
http://www.flickr.com/photos/fraserspeirs/tags/scotlandonrails2009/

P.S. Kevin - I owe you a beer towards the taxi Friday night!