So today's romp in the playpen I think it is time I picked a name-space and stuck to it!
Well after much snooping about and pondering on my part I and going to try to stick my DA in the 'Database' name-space.
That was actually the easy part was the above the tricky bit is figuring out want goes under it, as something like this DA::SQL->new() is what programers want rather than a rather long winded Database::Accessor::Driver::SQL::Connector->new();
So what to do?
Well the first thing is to come up with a clean name-space statement so here is mine;
The Database::Accessor package and all packages below it (Database::Accessor::*) are reserved for used by Database Accessors. Related modulers and extension will use the Database::AccessorX::* name-space. The name-space Database::Accessor::DAD::* are reserved for Data Accessor Drivers.
Update: I have just received notice that Gary Ashton-Jones, a Sydney Perl Monger and long time email list lurker, has lost his battle with prostate cancer. A terrible loss, especially to his wife and children. He will be missed.
Staples have kindly offered to host us tonight (10th of May) at their offices (Level 5, 163 O'Riordan Street, Mascot NSW). This is their first time hosting so everyone be on your best behavior so we can come back.
Start time: 6:30pm
Its ~4 mins walk to the train station, on street parking is free after 5pm.
• Ivan Wills has offered to speak on his latest project VTide
• Llyod Fouriner will speak (more) on his adventures in perl 6
If you would like to purchase a Sydney PM shirt (pictures at https://www.facebook.com/sydneypm) please let me know sizes asap to ensure i bring enough- although i will have a few sizes for impulse buys. They are $30 each and cover costs around meetup.com.
Now to circle back again. You may remember many many posts ago I wanted to make it a requirement for my LSD writers to have an SQL sub. I later revised the name to be a _retrieve sub that would be used to format the query up before it goes off to the DB/
Well in the end I think I am just going to leave it up to the LSD writer to write those subs as they see fit.
In the long run I think that is the only way to go as there is no way I can abstract out from my set and into a set of functions that covers every situation. So I guess my Christmas present for my LSD writes it the joy of just using the attributes that I supply from the DA.
This morning I uploaded Test2/Test-Simple combined into the Test-Simple distribution. You can find this distribution HERE for download. This is the result of 2 years of development on the testing infrastructure. See THIS document for important information about upgrading.
Because this is such an important module, and this release is such a big change, I have also prepared extra tarballs for Test2 and Test-Simple that completely revert the merge and bump the version by one. If a showstopper or emergency occurs I can upload them in an instant to put things back to mostly the way they were.
I am not anticipating any big issues with this. There has been a lot of testing with a huge focus on backwards compatibility. That said, nothing is ever completely bug free, specially when it is as big as this. If you find any issues please report them!
Along with this distribution I have released the following distributions as stable (up until now they have been listed as experimental)
GitPrep 2.0 is released at 2016-5-7. GitPrep is portable clone of GitHub. GitPrep work on CGI and own server. GitPrep 2.0 is major version up. It supports Pull request.
Support mail address. you can identify user by mail address.
Adding to user id, you can set user name.
you can set encoding, and diff option(which ignore space) at each project. If you write the setting in config file, you set these settings at project setting page.
Header for reverse proxy is change to X-Forwarded-Proto from X-Forwarded-HTTPS
Needed temporary file is created in gitprep directory. not more depend "/tmp"
GitPrep image and example
The following is GitPrep example URL. This is run as CGI at sakura rental server. If you access the following URL, You can use GitPrep. It support SSL.
So the time has come to pick which of the thee patterns I am going to choose to carry on. So here is how I evaluated each one giving advantages first.
Pure Moose;
Accomplished all system requirements, loaded and ran fast, required the least number of external modules, code easy to implement by LSD writers.
Requires the use of 'Klugeish' code son the DA side. The call '$class->new' can be confusing to some as this appears to be some sort of majik var. Options available on the interface are limited.
MooseX::ShortCut::BuildInstance;
Accomplished all system requirements, interface has many options which may prove useful, good name-space management, code easy to implement by LDS writers, clear interface on DA side of coding.
Slowest to load, has a moderate number of dependencies,
MooseX::Scaffold
Accomplished all system requirements, interface has many options which may prove useful
Second slowest to load, has a few dependencies, the code requires the most from the LSD writer and the interface for the DA writer is the largest.
It seems Sparrow project is getting stabilized with version 0.1.*, I don't think I am going to change API radically in the future ... The same for Outthentic which accordingly hit version 0.1.* as well.
The author tests in my module publication pipeline
are only one part of the task. The other tasks are actually running the checks,
making sure that my public Github repositories
are updated with each release and actually pushing the distribution file
out onto CPAN. Of course, I have these steps automated.
So now that that I have three prototypes out there for DA
Pure Moose
MooseX::Scaffold and
MooseX::ShortCut::BuildInstance
The question becomes which one to to choose. They all do what I want them to enforce my API , keep the LSD code from beading into the DA code and all allow me now enter just a connection object and the correct LSD will be loaded.
One thing to do is run some benchmark test to see how fast the various scripts load and then run. I might not matter at this early stage bu I could see that the LSDs could become rather extensive as my original one was something like 2000+ lines of code and that could take some time to load.
I know it is rather old school of me to look into this as given the speed of modern system instaniating my object would likely be one of the quicker part of the code and the actual query would be the long part of this code, but every little bit helps.
Why is that better? Because nobody knows what $" is, but everyone knows what join() is. Always write your software to be as readable as possible :)
I received a couple of upset replies along the lines of "Perl devs should be allowed to write Perl!" While I generally agree with that sentiment -- I had no problem with the array slice, for example -- I think the replies came, in part, because I had answered too quickly. I clarified what I meant, but I thought I should explain it here, too, because too many people reach for those punctuation variables.
Now I do have a working version of the MooseXs Scaffold and Shortcut and even built out the Shortcut version to not hard-code the LSD classes I might have to load. Now what I do not have a pure Moose version so I think I will stub that out now using what I have learned form the other Modules.
Now it really did not take much time or effort to make this a pure
Moose mod.
All I had to to was make some adjustments BUILD like this