<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>Dean Wampler's Mind</title>
    <link>http://blog.aspectprogramming.com/</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Ruminations and Ruinations on Software</description>
    <item>
      <title>Announcement: Polyglot Programming Site</title>
      <description>&lt;p&gt;I created a new web site, &lt;a href="http://www.polyglotprogramming.com"&gt;Polyglot Programming&lt;/a&gt;, that is dedicated to the emerging trend of building applications with multiple languages and multiple &amp;#8220;modularity paradigms&amp;#8221; (&lt;i&gt;e.g.&lt;/i&gt;, object-oriented, aspect-oriented, and functional programming).&lt;/p&gt;


	&lt;p&gt;There isn&amp;#8217;t much there yet. ;) Over time, I hope to add case studies, discussions of different languages, &lt;i&gt;etc&lt;/i&gt;.&lt;/p&gt;</description>
      <pubDate>Sun, 24 Aug 2008 20:55:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:3022ba53-2bd2-4dc9-bae0-9a40e60214c7</guid>
      <author>Dean Wampler</author>
      <link>http://blog.aspectprogramming.com/articles/2008/08/24/announcement-polyglot-programming-site</link>
      <category>AOP</category>
      <category>Polyglot Programming</category>
      <category>polyglot</category>
      <category>functions</category>
      <category>objects</category>
      <category>aspects</category>
      <trackback:ping>http://blog.aspectprogramming.com/articles/trackback/55</trackback:ping>
    </item>
    <item>
      <title>Raising a different exception in &amp;quot;after&amp;quot; or &amp;quot;after_raising&amp;quot; advice</title>
      <description>&lt;p&gt;An &lt;a href="http://aquarium.rubyforge.org"&gt;Aquarium&lt;/a&gt; user asked recently if you can use &lt;tt&gt;after_raising&lt;/tt&gt; advice to raise a different exception, &lt;i&gt;e.g.,&lt;/i&gt; to wrap the original exception. Now you can, with the commits I did today. (This change will appear in the forthcoming V0.4.2 release.) Actually, this feature was partially implemented already, but never finished (OOPS!)&lt;/p&gt;

&lt;p&gt;The following made-up example illustrates what you can do. Imagine you are one of the handful of Ruby programmers who &lt;i&gt;aren&amp;#8217;t&lt;/i&gt; using ActiveRecord ;) and you have an OracleDriver class that handles Oracle database transactions.

&lt;pre&gt;
&lt;code&gt;
class OracleDriver
  class OracleDriverException &amp;lt; StandardException; ...; end
  class ConnectionError &amp;lt; OracleDriverException; ...; end
  def connect
    if try_to_connect == false
      raise ConnectionError 
    end
    ...
  end
  def find query_parameters
    ...
  end
end
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;In the application code that uses the &lt;tt&gt;OracleDriver&lt;/tt&gt; you ignore any exceptions raised (because we will implement an exception handling strategy elsewhere&amp;#8230;).&lt;/p&gt;

&lt;pre&gt;
&lt;code&gt;
  ...
  def load_object oracle_driver, query_parameters
    oracle_driver.connect
    oracle_driver.find query_parameters
  end
  ...
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;Finally, you implement an application-wide exception handling strategy for any exceptions raised by the driver.&lt;/p&gt;

&lt;pre&gt;
&lt;code&gt;
Aspect.new :after_raising =&amp;gt; OracleDriverException, 
    :in_types =&amp;gt; ... do |jp, object, *args|
  # Ruby needs a standard way to wrap one exception in another.
  original = jp.context.raised_exception
  app_exception = ApplicationException.new(original.message)
  app_exception.set_backtrace(original.backtrace)
  jp.context.raised_exception = app_exception
end
&lt;/code&gt;
&lt;/pre&gt;

&lt;p&gt;In other words, any exceptions raised by calls to OracleDriver are wrapped in an &lt;tt&gt;ApplicationException&lt;/tt&gt;, which will be thrown by Aquarium when the advice block finishes.&lt;/p&gt;

&lt;p&gt;This technique can also be used when handling exceptions in &lt;tt&gt;after&lt;/tt&gt; advice.&lt;/p&gt;

&lt;p&gt;By the way, in a similar way, you can also change the return value in &lt;tt&gt;after&lt;/tt&gt; and &lt;tt&gt;after_returning&lt;/tt&gt; advice. In this case, you assign a new value to &lt;tt&gt;jp.context.returned_value&lt;/tt&gt;.&lt;/p&gt;</description>
      <pubDate>Sat, 26 Apr 2008 16:13:04 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:4e652833-7bfc-4336-b0a3-514d83fd53dc</guid>
      <author>Dean Wampler</author>
      <link>http://blog.aspectprogramming.com/articles/2008/04/26/raising-a-different-exception-in-after-or-after_raising-advice</link>
      <category>AOP</category>
      <category>Aquarium</category>
      <trackback:ping>http://blog.aspectprogramming.com/articles/trackback/54</trackback:ping>
    </item>
    <item>
      <title>Short presentation Aquarium</title>
      <description>&lt;p&gt;I just posted the &lt;a href="http://aspectprogramming.com/papers/Aquarium_AOP_for_Ruby_presentation.pdf"&gt;&lt;span class="caps"&gt;PDF&lt;/span&gt;&lt;/a&gt; for a short (30 minute) presentation on &lt;a href="http://aquarium.rubyforge.org"&gt;Aquarium&lt;/a&gt; that I presented to the aspect-oriented programming research community at the &lt;a href="http://aosd.net/2008/"&gt;Aspect-Oriented Software Development 2008 Conference&lt;/a&gt;. It assumes some familiarity with aspects, but not much experience with Ruby. The talk was based on my &lt;a href="http://www.aosd.net/2008/program/industry.php"&gt;Industry Track&lt;/a&gt; paper.&lt;/p&gt;


	&lt;p&gt;There is a &lt;a href="http://aspectprogramming.com/papers/Aquarium_RubyAOP.pdf"&gt;longer presentation on Aquarium&lt;/a&gt; on my &lt;a href="http://aspectprogramming.com/papers"&gt;papers&lt;/a&gt; page, which is better if you are new to &lt;span class="caps"&gt;AOP&lt;/span&gt; (although the syntax shown in the Aquarium examples is a bit dated&amp;#8230;).&lt;/p&gt;</description>
      <pubDate>Thu, 03 Apr 2008 04:37:23 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:ff241292-ac4a-4a38-a82b-613e006c0374</guid>
      <author>Dean Wampler</author>
      <link>http://blog.aspectprogramming.com/articles/2008/04/03/short-presentation-aquarium</link>
      <trackback:ping>http://blog.aspectprogramming.com/articles/trackback/53</trackback:ping>
    </item>
    <item>
      <title>ANN: Aquarium V0.4.0 Released with Initial Support for Java Aspects in Aquarium</title>
      <description>&lt;p&gt;The new V0.4.0 release of Aquarium adds support for JRuby. Not only do the regular &amp;ldquo;pure Ruby&amp;rdquo; Aquarium specs run reliably under JRuby (V1.1RC2), but you can now write aspects for Java types with Aquarium!&lt;/p&gt;


	&lt;p&gt;There are some limitations and issues. For details, see my &lt;a href="http://blog.objectmentor.com/articles/2008/02/25/writing-java-aspects-with-jruby-and-aquarium"&gt;blog&lt;/a&gt; at &lt;a href="http://blog.objectmentor.com"&gt;Object Mentor&lt;/a&gt; and the &lt;a href="http://aquarium.rubyforge.org/jruby.html"&gt;JRuby&lt;/a&gt; page at the Aquarium website.&lt;/p&gt;</description>
      <pubDate>Tue, 26 Feb 2008 12:12:25 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:24c72686-dc4f-4346-8342-f8b8a2310752</guid>
      <author>Dean Wampler</author>
      <link>http://blog.aspectprogramming.com/articles/2008/02/26/ann-aquarium-v0-4-0-released-with-initial-support-for-java-aspects-in-aquarium</link>
      <category>AOP</category>
      <category>Java and AspectJ</category>
      <category>Aquarium</category>
      <trackback:ping>http://blog.aspectprogramming.com/articles/trackback/51</trackback:ping>
    </item>
    <item>
      <title>ANN: Aquarium V0.3.0 released</title>
      <description>&lt;p&gt;I released V0.3.0 of Aquarium today. The most visible change is a new set of synonyms for many of the parameters passed to &lt;span class="caps"&gt;API&lt;/span&gt; methods, providing a more &amp;#8220;English-like&amp;#8221; feel. For example, previously, you might declare an aspect like this:&lt;/p&gt;

&lt;blockquote&gt;
&lt;code&gt;
    around :methods =&amp;gt; :all, :types =&amp;gt; [Foo, Bar], :advice =&amp;gt; advice_proc
&lt;/code&gt;
&lt;/blockquote&gt;
&lt;p&gt;
Now you can write the same aspect as follows:&lt;/p&gt;
&lt;blockquote&gt;
&lt;code&gt;
    around :calls_to =&amp;gt; :all_methods, :within_types =&amp;gt; [Foo, Bar], :use_advice =&amp;gt; advice_proc
&lt;/code&gt;
&lt;/blockquote&gt;
&lt;p&gt;
which reads more like English. &lt;/p&gt;
&lt;p&gt;
Similarly, attribute matching is simpler.&lt;/p&gt;

&lt;blockquote&gt;
&lt;code&gt;
    after  :attribute =&amp;gt; name, :attribute_options =&amp;gt; [:readers], :objects =&amp;gt; [foo, bar] ...
&lt;/code&gt;
&lt;/blockquote&gt;
&lt;p&gt;becomes&lt;/p&gt;
&lt;blockquote&gt;
&lt;code&gt;
    after  :reading =&amp;gt; name, :on_objects =&amp;gt; [foo, bar] ...
&lt;/code&gt;
&lt;/blockquote&gt;
&lt;p&gt;
There are many internal improvements to improve &lt;span class="caps"&gt;DRY&lt;/span&gt;&amp;#8217;ness, robustness, and performance. 
&lt;/p&gt;
&lt;p&gt;There should be no upgrade issues, so give it a try!&lt;/p&gt;</description>
      <pubDate>Mon, 21 Jan 2008 13:38:00 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:7d30889d-ea71-495e-9f6b-23c83dfd5375</guid>
      <author>Dean Wampler</author>
      <link>http://blog.aspectprogramming.com/articles/2008/01/21/ann-aquarium-v0-3-0-released</link>
      <category>AOP</category>
      <category>Aquarium</category>
      <trackback:ping>http://blog.aspectprogramming.com/articles/trackback/50</trackback:ping>
    </item>
    <item>
      <title>CJUG Downtown 12/18/07: Aspect-Oriented Programming and Software Design</title>
      <description>&lt;p&gt;I&amp;#8217;m reprising my &lt;a href="http://www.cjug.org/Wiki.jsp?page=2007.09.06.west"&gt;&lt;span class="caps"&gt;CJUG&lt;/span&gt; West talk&lt;/a&gt; on &lt;a href="http://www.cjug.org/Wiki.jsp?page=2007.12.18.downtown"&gt;Aspect-Oriented Programming and Software Design in Java and AspectJ&lt;/a&gt; for the downtown Chicago group on December 18th.&lt;/p&gt;


	&lt;p&gt;I will briefly describe the problems that &lt;span class="caps"&gt;AOP&lt;/span&gt; addresses and how the principles of object-oriented design influence &lt;span class="caps"&gt;AOP&lt;/span&gt; and vice versa. If you&amp;#8217;re in the area, I hope to see you &lt;a href="http://www.cjug.org/Wiki.jsp?page=2007.12.18.downtown"&gt;there&lt;/a&gt;.&lt;/p&gt;</description>
      <pubDate>Sat, 08 Dec 2007 12:02:14 -0600</pubDate>
      <guid isPermaLink="false">urn:uuid:8cef9449-5110-4429-84c7-5615b6fcc3ba</guid>
      <author>Dean Wampler</author>
      <link>http://blog.aspectprogramming.com/articles/2007/12/08/cjug-downtown-12-18-07-aspect-oriented-programming-and-software-design</link>
      <category>AOP</category>
      <category>Java and AspectJ</category>
      <trackback:ping>http://blog.aspectprogramming.com/articles/trackback/49</trackback:ping>
    </item>
    <item>
      <title>Presentation on AOP in Academia and Industry</title>
      <description>&lt;p&gt;Yesterday evening, I gave a talk on &lt;span class="caps"&gt;AOP&lt;/span&gt; at &lt;a href="http://www.depaul.edu/"&gt;DePaul University&lt;/a&gt; called &lt;em&gt;Aspect-Oriented Programming in Academia and Industry&lt;/em&gt;. Here&amp;#8217;s the &lt;a href="http://aspectprogramming.com/papers/AOP_Academia_and_Industry.pdf"&gt;&lt;span class="caps"&gt;PDF&lt;/span&gt;&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;This talk was a little different than the usual talks I give. Since this audience was mostly students and faculty, I wanted to show how groups in both industry and academia were looking at similar problems that led to the emergence of &lt;span class="caps"&gt;AOP&lt;/span&gt;, how they each contributed to &lt;span class="caps"&gt;AOP&lt;/span&gt; in different ways, and how they can continue complementing each other&amp;#8217;s work on emerging trends, like &lt;a href="http://en.wikipedia.org/wiki/Language-oriented_programming"&gt;Language-Oriented Programming&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;&lt;a href="http://en.wikipedia.org/wiki/Language-oriented_programming"&gt;Language-Oriented Programming&lt;/a&gt; is not a new idea, but it is getting renewed attention recently. I see it as a way of formalizing our understanding of how &lt;a href="http://martinfowler.com/bliki/DomainSpecificLanguage.html"&gt;Domain-Specific Languages&lt;/a&gt; should be designed.&lt;/p&gt;


	&lt;p&gt;I&amp;#8217;m a little concerned that everyone will get so excited about crafting &amp;#8220;elegant&amp;#8221; DSLs that we&amp;#8217;ll end up with a &lt;a href="http://en.wikipedia.org/wiki/Tower_of_Babel"&gt;Tower of Babel&lt;/a&gt; situation; lots of gratuitously-different ways of describing the same thing and no one getting much work done.&lt;/p&gt;


	&lt;p&gt;Anyway, we&amp;#8217;ll see&amp;#8230;&lt;/p&gt;</description>
      <pubDate>Sat, 20 Oct 2007 20:50:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:6928f8d3-afad-47b6-a8e0-77de878057d9</guid>
      <author>Dean Wampler</author>
      <link>http://blog.aspectprogramming.com/articles/2007/10/20/presentation-on-aop-in-academia-and-industry</link>
      <category>AOP</category>
      <trackback:ping>http://blog.aspectprogramming.com/articles/trackback/48</trackback:ping>
    </item>
    <item>
      <title>Presentation on Aquarium with Exercises</title>
      <description>&lt;p&gt;I&amp;#8217;ve posted a &lt;a href="http://aspectprogramming.com/papers/Aquarium_RubyAOP.pdf"&gt;&lt;span class="caps"&gt;PDF&lt;/span&gt;&lt;/a&gt; for the presentation I did last night on &lt;a href="http://aquarium.rubyforge.org/"&gt;Aquarium&lt;/a&gt; at the Chicago Ruby Users Group (Chirb).&lt;/p&gt;


	&lt;p&gt;I also posted a &lt;a href="http://aspectprogramming.com/papers/Aquarium_RubyAOP_exercises.zip"&gt;zip&lt;/a&gt; file with three exercises that are adapted from the examples on the aquarium web site.&lt;/p&gt;</description>
      <pubDate>Tue, 02 Oct 2007 14:06:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:46764fb9-bcc2-41dd-9946-20010e605d6b</guid>
      <author>Dean Wampler</author>
      <link>http://blog.aspectprogramming.com/articles/2007/10/02/presentation-on-aquarium-with-exercises</link>
      <category>AOP</category>
      <category>Ruby and Ruby on Rails</category>
      <category>Aquarium</category>
      <trackback:ping>http://blog.aspectprogramming.com/articles/trackback/47</trackback:ping>
    </item>
    <item>
      <title>Speaking at the Chicago Ruby Users Group (Chirb)</title>
      <description>&lt;p&gt;I will give a presentation on Aquarium at Chirb this Monday evening, Oct. 1st. David Chelimsky will also be speaking on new developements in RBehave and RSpec. Details are &lt;a href="http://chirb.org/"&gt;here&lt;/a&gt;.&lt;/p&gt;


	&lt;p&gt;David and I will be doing a joint presentation at the December meeting. It will be a tutorial on Ruby metaprogramming.&lt;/p&gt;</description>
      <pubDate>Sat, 29 Sep 2007 08:30:28 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:5bc010d2-a2d7-462a-b851-ae7bf225a3d3</guid>
      <author>Dean Wampler</author>
      <link>http://blog.aspectprogramming.com/articles/2007/09/29/speaking-at-the-chicago-ruby-users-group-chirb</link>
      <category>Ruby and Ruby on Rails</category>
      <category>Aquarium</category>
      <trackback:ping>http://blog.aspectprogramming.com/articles/trackback/46</trackback:ping>
    </item>
    <item>
      <title>ANN: Aquarium v0.1.5 released</title>
      <description>&lt;p&gt;This is primarily a bug-fix release. I labeled it &amp;#8220;v0.1.5&amp;#8221; instead of &amp;#8220;v0.1.1&amp;#8221;, because a non-trivial &lt;span class="caps"&gt;API&lt;/span&gt; change was required; Aquarium no longer automatically adds methods to &lt;code&gt;Object&lt;/code&gt;, due to collisions with Rails. This means that users of the &amp;#8220;DSL methods&amp;#8221; will need to require a new file or include a new module.&lt;/p&gt;


	&lt;p&gt;See the &amp;#8220;CHANGES&amp;#8221; file in the distribution of &lt;a href="http://aquarium.rubyforge.org/changes.html"&gt;here&lt;/a&gt; for more information.&lt;/p&gt;</description>
      <pubDate>Mon, 17 Sep 2007 21:15:00 -0500</pubDate>
      <guid isPermaLink="false">urn:uuid:049342b2-318c-4eda-b2aa-77b8a479149a</guid>
      <author>Dean Wampler</author>
      <link>http://blog.aspectprogramming.com/articles/2007/09/17/ann-aquarium-v0-1-5-released</link>
      <category>AOP</category>
      <category>Ruby and Ruby on Rails</category>
      <category>Aquarium</category>
      <trackback:ping>http://blog.aspectprogramming.com/articles/trackback/41</trackback:ping>
    </item>
  </channel>
</rss>
