I am cross posting this here on the off chance that anyone who heard me
ramble incoherently a month ago about Reaction was interested. This is the
first public incarnation of the module I described used to limit data
availability at the model layer through the use of restricting methods,
effectively making it very hard to accidentally leak that you shouldn't
through careless programming. I know Ronald finally took the plunge and saw
the ORM light, so maybe the rest of you should try it too! It's simpler than
it looks, I promise. Full docs too.
---

This morning I shipped off to the CPAN the first version of
DBIX::Class::Schema::RestrictWithObject. Originally hacked by mst as
RestrictByUser, this handy-dandy DBIx::Class::Schema component allows you to
automatically restrict your schemas with an object, meaning that all calls
to resultset() will be intercepted and optionally filtered with a method in
the restricting object. An example of a place where you could use this is a
Catalyst application where you could restrict the schema of logged in users
and automatically restrict their resultsets items that are associated with
them. This example is in the POD. Why is this a plus?

   - Ability to centralize restrictions into one class / file making them
   easier to maintain and locate
   - Less complexity when using data sets. With careful programming you
   can be sure that you will not accidentally expose data by forgetting to
   filter it because it is filtered at the model level.
   - Less clutter in your application because the code to restrict data
   sets is in a different place.
   - Easy switching of restricting objects to support many different rule
   sets. By using  Class::MOP or Moose you could conceivably generate new rule
   sets at runtime. Everyone loves Moose!

Take it for a test drive and if you are not satisfied send me an email and
I'll consider your suggestions.

DBIx-Class-Schema-RestrictWithObject-0.0001<http://search.cpan.org/%7Egroditi/DBIx-Class-Schema-RestrictWithObject-0.0001/>
 
_______________________________________________
Boston-pm mailing list
[email protected]
http://mail.pm.org/mailman/listinfo/boston-pm

Reply via email to