Thursday, 5 January 2012

Notice this?

If you are looking for a working example of CGI::Application combining the plug-ins:

CGI::Application::Plugin::ConfigAuto
CGI::Application::Plugin::DBH
CGI::Application::Plugin::Session
CGI::Application::Plugin::Authentication
CGI::Application::Plugin::Redirect
CGI::Application::Plugin::DBIC::Schema
CGI::Application::Plugin::Forward
CGI::Application::Plugin::TT

in a working  MVC (DBIC,TT,CAS) framework, then Notice should help you. I use it as a Customer Resource and Account Manager; Asset management, but you can adapt it to your needs. Notice is the  distillation of almost twenty years of Internet related solutions. Being a general outline of an idea to, "solve all of the Internet problems" it has a very expansive remit.

Although this example, on github, is from an earlier development branch, it certainly would have saved me some time if even this incarnation of Notice had already existed, when I was looking through the many good Perl frameworks for the one that met my needs.



(This incarnation of Notice is inspired by CGI::Application::Structured and a direct port of my previous, all-my-own-code-from-the-ground-up, version of of Notice.)

I hope that someone will find it useful. Being the outline of the Notice modular system, (that is using the CGI::Application framework), it is easy to create a custom module that stores your data in any way that you want, (or you can strip it down to the bones and build your own animal.)

Notice is interesting for at least two reasons, (possibly more).

First it is an example of a light MVC framework using DBIx::Class and Template::Toolkit. I started out by looking at the largest most popular MVC framework in CPAN; it is great, but I needed something lighter, so I looking for the lightest, (CGI::). ( My previous version of Notice had started out using CGI_light, but eventually I stripped out all dependencies except DBI.)

I found a collection of tutorials, but never quite the full combination (of Authentication with dbic and TT) that I needed, (actually I wanted L18n as well but I did not have time when I was creating this third incarnation for Notice. xkcd.com/974/)

Second I was spending a weekend building a domain registry, (it really isn't that hard) and needed a whois server; I could find an almost endless collection of code to talk to/with a whois server, but not actually a whois daemon. So in the S of Model, View, Control, Sundries is a little RFC3912 compliant whois daemon. If you create a CDB file with a key of awesome.alexx.net and a value of "Why YOU are my friend, you are!" this daemon will serve it up for you. ( It is trivial to have the whois server pull live data from the database - your milage may vary with the level and volume of DDoS or /. directed at your server.)

The unsuspecting world should know that this version is NOT an example of perfect code. Feel free to improve it, laugh at it, (I do) or make a version with the features that you need, e.g. L18n. I'm extending the assets section to have hive-records for for the beehives that I now have listed in my  assets table.

If you need an example of the features mentioned at the start of this post, (or a whois server), this may save you time. Also, there are many modules that have already been developed, that have not been included in this code. I will include a new README, (and possibly a blog entry) explaining the modules and how each instance of Notice can interact with all of the others, (or you can email me with questions about Notice.)

[I have published the whois server separately in CPAN, but with this you can automate the rebuilding, (and distribution) of the whois database from a central management system. I have not yet got permission to include all of the custom code that did the DNSSEC. That sat on a computer with no external access; pulled each zonefile; signed them; pushed them out to each DNS server. ]

This is not another framework; It is an example of CGI::Application. If you ask why?:
Catalyst seems like the daddy-bear of frame-works, (though Mojolicious will be 'The Daddy' for some) and all the others seemed like mummy-bear, so Notice is my baby-bear;

I hope that someone else will think that it is 'just right'.

No comments:

Post a Comment

About this blog

Sort of a test blog... until it isn't