Hi Josh, You should have started this conversation on -devel but that's fine, I added everyone now ;)
[snip] > > Why not, for most of the modules in lib/pf, have a directory with > custom.pm and modify the code in the rest of PF to call this code? > > You'd have /usr/local/pf/lib/pf/node/custom.pm which would use the base > of /usr/local/pf/lib/node.pm but allow folks to overload any function > like you do in radius or vlan but more globally for things that may be > modified. [snip] > Do you see any pitfalls or reasons why this couldn't get pushed into the > main codebase? I could see this working for person, node, and web > modules. Possibly more. The issue that makes it less trivial than one would think is that we need to objectify all these modules. This now means that we have to control entry points (and create objects there), make sure they have no state side effect and pass objects along in the call hierarchies everywhere. Also, a Perl design decision makes life more complicated. Only method calls are inherited which means that all the 'our' variables in these packages would need to be hidden behind accessors. For database-oriented modules like pf::person or pf::node this makes life a bit more complicated since we are sharing the database statement handler in a 'our' hash. The idea is great (although I'm unsure if we should do it all under a <module>/custom.pm nomenclature..) but the implementation would be intrusive and potentially introduce a lot of regressions. Which I'm not willing to do in trunk yet since we, strangely enough, deployed a couple of trunk releases as proof of concepts for clients (the 802.1X/MAB stuff in there is just too awesome!). Now, as a base for further discussions: There might be another way to accomplish the same goal without going object? TIMTOWTDI[1]. We are using the Perl dynamic language after all! [1] http://en.wikipedia.org/wiki/There's_more_than_one_way_to_do_it -- Olivier Bilodeau obilod...@inverse.ca :: +1.514.447.4918 *115 :: www.inverse.ca Inverse inc. :: Leaders behind SOGo (www.sogo.nu) and PacketFence (www.packetfence.org) ------------------------------------------------------------------------------ The Palm PDK Hot Apps Program offers developers who use the Plug-In Development Kit to bring their C/C++ apps to Palm for a share of $1 Million in cash or HP Products. Visit us here for more details: http://p.sf.net/sfu/dev2dev-palm _______________________________________________ Packetfence-devel mailing list Packetfence-devel@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/packetfence-devel