Metro 0.3.1 Released

2009 January 08
by Paul Marcotte

While in the process of generating documentation for Metro (using Mark Mandel's excellent Colddoc), I realized that I am generally remiss about using hint. Therefore, I embarked on a mission of adding hints to the Metro library. During the course of this exercise, I chose to re-factor a few items that I wasn't completely happy with. The result is Metro 0.3.1.

Here are the important changes:

  1. Re-factor the Audit decorator, AuditObserver and sql into security package
    Auditing is really about security (imo) and since my Audit object definition contained a UserId property, I decided to go all the way and create manytoone reference to User for the Audit object. I also updated the observer to optionally track BeforeDelete events in addition to AfterCreate and AfterUpdate. Finally, I eliminated the audtit package.
  2. Added hints to components, methods and arguments.
    As mentioned in the introduction, hinting helped clarify the intent of my code and makes the documentation much easier to follow. I highly recommend getting into the habit of using hint.
  3. Updated the tests configuration to enable the Audit Observer during SecurityService tests.
    What better way to test the observer than to create and delete Users with the SecurityService test case? I'll write up a specific post on this to clarify what the Audit observer is about and why I decided to use this design choice in a future post. If you like to dig in and see how it is enabled, simply check out the ColdSpring XML bean definitions in the /tests/config folder.
  4. ServiceFactory now supports creation of concrete classes that extend metro.core.Service and metro.core.Gateway recursively
    Again, while working on a new project based on Metro, I wanted the ability to extend the metro.security.SercurityService class instead of metro.core.Service, so with a little help from Jon Messer for spotting my recursion miscue, I enabled this feature.

Stay tuned for information about additional Metro resources in the near future.