The Artima Developer Community
Sponsored Link

Agile Buzz Forum
Exptional Announcements are Exceptional when Announced

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
James Robertson

Posts: 29924
Nickname: jarober61
Registered: Jun, 2003

David Buck, Smalltalker at large
Exptional Announcements are Exceptional when Announced Posted: May 9, 2006 8:09 PM
Reply to this message Reply

This post originated from an RSS feed registered with Agile Buzz by James Robertson.
Original Post: Exptional Announcements are Exceptional when Announced
Feed Title: Travis Griggs - Blog
Feed URL: http://www.cincomsmalltalk.com/rssBlog/travis-rss.xml
Feed Description: This TAG Line is Extra
Latest Agile Buzz Posts
Latest Agile Buzz Posts by James Robertson
Latest Posts From Travis Griggs - Blog

Advertisement

One of the interesting problems that presents itself when doing code with lots of user interaction, is how to write tests for the underlying stuff, that don't require all kinds of user interaction. Announcements and Exceptions both provide a mechanism for separating out the logic of a user driven process so that it can be tested independent of the user interactions otherwise. They actually overlap a bit, but each has their strengths. Since I try to write lots of tests, I use the technique of using an Exception or Announcment to loosely couple a process with it's UI quite often.

How amused to see this had gone maybe a little far today. I wrote this code. Or took part in most of it. I discovered a process that started out as an Exception raised from with the VisualWorks core library (an IO exception to be more precise). This exception was then trapped by our own stuff and recast as a domain specific exception. Another layer out trapped that exception, and on doing so, would broadcast an announcement. Another process wanting to be aware of the changes implicated by the announcment, decided to listen for that announcement. When it got it, it chose to raise an exception. Which was in turn handled and broadcast as a UI specific announcement. To sum up:

exception -> exception -> announcement -> exception -> announcement

I guess I can't complain about all the layers of exception handling in the Parcel loading process anymore.

Read: Exptional Announcements are Exceptional when Announced

Topic: Meanwhile, Back in Maine... Previous Topic   Next Topic Topic: It works better when you plug it in

Sponsored Links



Google
  Web Artima.com   

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