Hello dear DBICx users, I am currently working on a project, and I suddenly realized that I should have asked for your wise suggestions before jumping into that maybe useless project.
The goal is to provide dynamic columns to dbix result objects. I was inspired by the DBICx::VirtualColumns package, but I do not store any value into the row object, just override methods that use user supplied callbacks to get the value. The overall intended usage is to provide some "view" columns that can be transparently used as is they were actual columns, for instance by CatalystX::ExtJS::REST to provide a table view of the tables that incorporate the new columns. To be more concrete, suppose that you have User table, with a foreign key user_type_id on a UserType table (a lookup table). You'd like your nice extjs grid automatically filled thanks to CatalystX::ExtJS::REST to display a user_type column, because the "user_type_id" column is not veru useful for your customers. Using DBICx::DynamicColumns, you could tie the (new) method/column "type" to $row->user_type()->name() for instance. Another intended use is to provide accessors for another project that will provide some optimized cache and useful accessors/checks for this kind of Lookup tables. I currently have a prototype that only works for one table, and that is very hackish because I sometimes have to hide the dynamic columns, and so wrap the methods that should not see those dynamic columns. What do you think ?? Is-it a valid approach ? Thanks.
_______________________________________________ List: http://lists.scsys.co.uk/cgi-bin/mailman/listinfo/dbix-class IRC: irc.perl.org#dbix-class SVN: http://dev.catalyst.perl.org/repos/bast/DBIx-Class/ Searchable Archive: http://www.grokbase.com/group/dbix-class@lists.scsys.co.uk