Hi there! I was looking for anykind of Interface implementation for Perl, and I found Moose and Class::Interface. I cant but wonder why we are not using Moose for Koha::Object. Apparently it works nicely with DBIx as well. -- Olli-Antti Kivilahti Järjestelmäkeittäjä vaarakirjastot.fi +358 50 449 7763 --Powered by Kubuntu Linux!
Since Koha::Object(s) is used for with inheritance interfaces aren't really necessary. Simply declaring Koha::Object(s) as a base for your module will mean those methods already exists. The only time you need to define one of those methods is if you need to override the base behavior ( to add error checking, modify related objects, etc ). I believe the primary issue is start-up time needed for Moose, which makes it untenable for basic cgi script usage ( as opposed to PSGI/Plack where it only needs to load once ). In general I'm a fan of interfaces, so I'm not opposed to the idea. Can you explain what advantage you think we'd can from implementing interfaces for Koha::Object(s)? Thanks! Kyle http://www.kylehall.info ByWater Solutions ( http://bywatersolutions.com ) Meadville Public Library ( http://www.meadvillelibrary.org ) Crawford County Federated Library System ( http://www.ccfls.org ) Mill Run Technology Solutions ( http://millruntech.com ) On Mon, Jul 27, 2015 at 6:58 AM, Kivilahti Olli-Antti < olli-antti.kivilahti@jns.fi> wrote:
Hi there!
I was looking for anykind of Interface implementation for Perl, and I found Moose and Class::Interface.
I cant but wonder why we are not using Moose for Koha::Object. Apparently it works nicely with DBIx as well.
--
Olli-Antti Kivilahti Järjestelmäkeittäjä vaarakirjastot.fi +358 50 449 7763 --Powered by Kubuntu Linux! _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
Thanks for all the replies! I am not a Moose-fan so just curious. I use Interfaces to create a contract between objects so different implementations can fill the same role. Just like they are intended to be used :) I am not implying to force some kind of an Interface-mechanism to Koha::Object. I am satisfied with it. I am deploying Interfaces to the Authentication rewrite and TestObject Factories to enforce subclass component interoperatibility in a formal way. (what a sentence...) Olli-Antti Kivilahti Järjestelmäkeittäjä vaarakirjastot.fi +358 50 449 7763 --Powered by Kubuntu Linux! On 27.07.2015 14:04, Kyle Hall wrote: Since Koha::Object(s) is used for with inheritance interfaces aren't really necessary. Simply declaring Koha::Object(s) as a base for your module will mean those methods already exists. The only time you need to define one of those methods is if you need to override the base behavior ( to add error checking, modify related objects, etc ). I believe the primary issue is start-up time needed for Moose, which makes it untenable for basic cgi script usage ( as opposed to PSGI/Plack where it only needs to load once ). In general I'm a fan of interfaces, so I'm not opposed to the idea. Can you explain what advantage you think we'd can from implementing interfaces for Koha::Object(s)? Thanks! Kyle http://www.kylehall.info ByWater Solutions ( http://bywatersolutions.com ) Meadville Public Library ( http://www.meadvillelibrary.org ) Crawford County Federated Library System ( http://www.ccfls.org ) Mill Run Technology Solutions ( http://millruntech.com ) On Mon, Jul 27, 2015 at 6:58 AM, Kivilahti Olli-Antti <olli-antti.kivilahti@jns.fi<mailto:olli-antti.kivilahti@jns.fi>> wrote: Hi there! I was looking for anykind of Interface implementation for Perl, and I found Moose and Class::Interface. I cant but wonder why we are not using Moose for Koha::Object. Apparently it works nicely with DBIx as well. -- Olli-Antti Kivilahti Järjestelmäkeittäjä vaarakirjastot.fi<http://vaarakirjastot.fi> +358 50 449 7763<tel:%2B358%2050%20449%207763> --Powered by Kubuntu Linux! _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org<mailto:Koha-devel@lists.koha-community.org> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
I think authentication is the perfect way to use interfaces in Koha! That way we can have a standard API for authentication be it internal, ldap, cas, or whatever! Right now the way C4::Auth and it's ilk are mixed together definitely creates headaches when attempting to debug authentication issues. Olli++ http://www.kylehall.info ByWater Solutions ( http://bywatersolutions.com ) Meadville Public Library ( http://www.meadvillelibrary.org ) Crawford County Federated Library System ( http://www.ccfls.org ) Mill Run Technology Solutions ( http://millruntech.com ) On Mon, Jul 27, 2015 at 7:18 AM, Kivilahti Olli-Antti < olli-antti.kivilahti@jns.fi> wrote:
Thanks for all the replies!
I am not a Moose-fan so just curious.
I use Interfaces to create a contract between objects so different implementations can fill the same role. Just like they are intended to be used :) I am not implying to force some kind of an Interface-mechanism to Koha::Object. I am satisfied with it.
I am deploying Interfaces to the Authentication rewrite and TestObject Factories to enforce subclass component interoperatibility in a formal way. (what a sentence...)
Olli-Antti Kivilahti Järjestelmäkeittäjävaarakirjastot.fi+358 50 449 7763 --Powered by Kubuntu Linux!
On 27.07.2015 14:04, Kyle Hall wrote:
Since Koha::Object(s) is used for with inheritance interfaces aren't really necessary. Simply declaring Koha::Object(s) as a base for your module will mean those methods already exists. The only time you need to define one of those methods is if you need to override the base behavior ( to add error checking, modify related objects, etc ).
I believe the primary issue is start-up time needed for Moose, which makes it untenable for basic cgi script usage ( as opposed to PSGI/Plack where it only needs to load once ).
In general I'm a fan of interfaces, so I'm not opposed to the idea. Can you explain what advantage you think we'd can from implementing interfaces for Koha::Object(s)?
Thanks! Kyle
http://www.kylehall.info ByWater Solutions ( http://bywatersolutions.com ) Meadville Public Library ( http://www.meadvillelibrary.org ) Crawford County Federated Library System ( http://www.ccfls.org ) Mill Run Technology Solutions ( http://millruntech.com )
On Mon, Jul 27, 2015 at 6:58 AM, Kivilahti Olli-Antti < olli-antti.kivilahti@jns.fi> wrote:
Hi there!
I was looking for anykind of Interface implementation for Perl, and I found Moose and Class::Interface.
I cant but wonder why we are not using Moose for Koha::Object. Apparently it works nicely with DBIx as well.
--
Olli-Antti Kivilahti Järjestelmäkeittäjä vaarakirjastot.fi +358 50 449 7763 --Powered by Kubuntu Linux! _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
Kyle Hall schreef op ma 27-07-2015 om 07:22 [-0400]:
I think authentication is the perfect way to use interfaces in Koha! That way we can have a standard API for authentication be it internal, ldap, cas, or whatever! Right now the way C4::Auth and it's ilk are mixed together definitely creates headaches when attempting to debug authentication issues.
I've been complaining to anyone who'd listen that our current way of doing auth is hacks upon hacks upon hacks, and if I had all the time in the world I'd rewrite it using a modular architecture, along these lines. Then you can configure the classes in koha-conf.xml, and have a sequence, e.g.: <auth> <koha save="true" /> <!-- koha internal auth is checked first, save this login if it succeeds and isn't already here --> <certificate certfield="commonname" kohafield="email" /> <!-- SSL client certificates is checked second --> <ldap> ... ldap details ... </ldap> </auth> or something along those lines, so you can build up your own authentication process. Unfortunately, I don't have all the time in the world, so this hasn't been anything more than a thought experiment for me so far :) -- Robin Sheat Catalyst IT Ltd. ✆ +64 4 803 2204 GPG: 5FA7 4B49 1E4D CAA4 4C38 8505 77F5 B724 F871 3BDF
Hi there! Have you taken a look at this? Bug 7174<http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=7174> - Authentication rewriting It is not configuration file -driven, but it is almost 100% of what you described with some added bonuses. With a looong list of complex dependencies. Olli-Antti Kivilahti Järjestelmäkeittäjä vaarakirjastot.fi +358 50 449 7763 --Powered by Kubuntu Linux! On 28.07.2015 02:48, Robin Sheat wrote: Kyle Hall schreef op ma 27-07-2015 om 07:22 [-0400]: I think authentication is the perfect way to use interfaces in Koha! That way we can have a standard API for authentication be it internal, ldap, cas, or whatever! Right now the way C4::Auth and it's ilk are mixed together definitely creates headaches when attempting to debug authentication issues. I've been complaining to anyone who'd listen that our current way of doing auth is hacks upon hacks upon hacks, and if I had all the time in the world I'd rewrite it using a modular architecture, along these lines. Then you can configure the classes in koha-conf.xml, and have a sequence, e.g.: <auth> <koha save="true" /> <!-- koha internal auth is checked first, save this login if it succeeds and isn't already here --> <certificate certfield="commonname" kohafield="email" /> <!-- SSL client certificates is checked second --> <ldap> ... ldap details ... </ldap> </auth> or something along those lines, so you can build up your own authentication process. Unfortunately, I don't have all the time in the world, so this hasn't been anything more than a thought experiment for me so far :) _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org<mailto:Koha-devel@lists.koha-community.org> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
Kivilahti Olli-Antti schreef op di 28-07-2015 om 03:57 [+0000]:
Have you taken a look at this?
Bug 7174 - Authentication rewriting
It is not configuration file -driven, but it is almost 100% of what you described with some added bonuses.
I haven't had a chance to yet, still trying to avoid getting sucked in to anything that's not elasticsearch related right now.
With a looong list of complex dependencies.
I sure hope you read my post about dependencies from a few months back :) In case you didn't: http://wiki.koha-community.org/wiki/Building_Debian_Dependencies/Dependency_... -- Robin Sheat Catalyst IT Ltd. ✆ +64 4 803 2204 GPG: 5FA7 4B49 1E4D CAA4 4C38 8505 77F5 B724 F871 3BDF
We are very much looking forward to the ES-thing, and certainly will be one of the early adopters. Hoping to help you Q1 2016, if our schedule holds (which it certainly hasn't regarding the Koha REST API). Thanks for the link! Olli-Antti Kivilahti Järjestelmäkeittäjä vaarakirjastot.fi +358 50 449 7763 --Powered by Kubuntu Linux! On 28.07.2015 07:30, Robin Sheat wrote: Kivilahti Olli-Antti schreef op di 28-07-2015 om 03:57 [+0000]: Have you taken a look at this? Bug 7174 - Authentication rewriting It is not configuration file -driven, but it is almost 100% of what you described with some added bonuses. I haven't had a chance to yet, still trying to avoid getting sucked in to anything that's not elasticsearch related right now. With a looong list of complex dependencies. I sure hope you read my post about dependencies from a few months back :) In case you didn't: http://wiki.koha-community.org/wiki/Building_Debian_Dependencies/Dependency_... _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org<mailto:Koha-devel@lists.koha-community.org> http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
We are very much interested in this. Both the great start that Olli is doing and the excellent ideas that Robin has to add on top. In Fact we've added this to our list to find funding for, for after we've finished the ES project. So help us finish the ES project faster (hint hint - test test - more information is coming in the newsletter) and we'll start raising money towards an excellent Auth (in the future). Cheers, Brendan On Mon, Jul 27, 2015 at 9:30 PM, Robin Sheat <robin@catalyst.net.nz> wrote:
Kivilahti Olli-Antti schreef op di 28-07-2015 om 03:57 [+0000]:
Have you taken a look at this?
Bug 7174 - Authentication rewriting
It is not configuration file -driven, but it is almost 100% of what you described with some added bonuses.
I haven't had a chance to yet, still trying to avoid getting sucked in to anything that's not elasticsearch related right now.
With a looong list of complex dependencies.
I sure hope you read my post about dependencies from a few months back :)
In case you didn't:
http://wiki.koha-community.org/wiki/Building_Debian_Dependencies/Dependency_...
-- Robin Sheat Catalyst IT Ltd. ✆ +64 4 803 2204 GPG: 5FA7 4B49 1E4D CAA4 4C38 8505 77F5 B724 F871 3BDF
_______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
-- --------------------------------------------------------------------------------------------------------------- Brendan A. Gallagher ByWater Solutions CEO Support and Consulting for Open Source Software Installation, Data Migration, Training, Customization, Hosting and Complete Support Packages Headquarters: Santa Barbara, CA - Office: Redding, CT Phone # (888) 900-8944 http://bywatersolutions.com info@bywatersolutions.com
Greetings, Because we were already using Class::Accessor? I don't know why. Also, Moose is much heavier than Mouse or Moo. Those are my guesses. GPML, Mark Tompsett -----Original Message----- From: Kivilahti Olli-Antti Sent: Monday, July 27, 2015 6:58 AM To: Koha-devel@lists.koha-community.org Subject: [Koha-devel] Koha::Object Hi there! I was looking for anykind of Interface implementation for Perl, and I found Moose and Class::Interface. I cant but wonder why we are not using Moose for Koha::Object. Apparently it works nicely with DBIx as well. -- Olli-Antti Kivilahti Järjestelmäkeittäjä vaarakirjastot.fi +358 50 449 7763 --Powered by Kubuntu Linux! _______________________________________________ Koha-devel mailing list Koha-devel@lists.koha-community.org http://lists.koha-community.org/cgi-bin/mailman/listinfo/koha-devel website : http://www.koha-community.org/ git : http://git.koha-community.org/ bugs : http://bugs.koha-community.org/
participants (5)
-
Brendan Gallagher -
Kivilahti Olli-Antti -
Kyle Hall -
Mark Tompsett -
Robin Sheat