Discussion:
[cgi-prototype-users] Moose implementation of CGI::Prototype
Terrence Brannon
2009-08-23 19:03:28 UTC
Permalink
Randal wants to maintain prototype-based OOP for a Moose-based version
of CGI::Prototype. I'm wondering if such a Moose class could be as
simple as:


package CGI::Prototype::Moose;

use Moose;
extends 'Class::Prototyped';

...

1;

Links:
------
* There is a sample prototype OO moose in this test example:
http://github.com/nothingmuch/moose/blob/0bb2cc8a6a2e4b967b5d8efbcf1ab27f5d95e990/t/200_examples/006_example_Protomoose.t

but I dont fancy breaking with the Class::Prototyped API.

* My current fork of CGI::Prototype which uses Moose:
http://github.com/metaperl/perl-module-cgi-prototype/blob/f3c71299cd98de7b4c4d2b291d95623a761db548/lib/CGI/Prototype/Moose.pm
Randal L. Schwartz
2009-08-23 19:18:48 UTC
Permalink
Terrence> Randal wants to maintain prototype-based OOP for a Moose-based version
Terrence> of CGI::Prototype. I'm wondering if such a Moose class could be as
Terrence> simple as:


Terrence> package CGI::Prototype::Moose;

Terrence> use Moose;
Terrence> extends 'Class::Prototyped';

Not really. The prototype stuff of Moose is where you want to start, and it
has a different interface. If you just pulled in Class::Prototyped, you'd
have a lot of potential conflicts, especially around anonymous classes.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<***@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
Terrence Brannon
2009-08-30 22:41:15 UTC
Permalink
Post by Randal L. Schwartz
Not really. The prototype stuff of Moose is where you want to start, and it
has a different interface. If you just pulled in Class::Prototyped, you'd
have a lot of potential conflicts, especially around anonymous classes.
I see. I'm not trying to anger you, but I would like to re-join our IRC
conversation. If you read the CGIP docs, it speaks of 'the prototypical
cgi application' -

* Analyze the incoming parameters, cookies, and URLs to determine
the state of the application (let's call this "dispatch").
* Based on the current state, analyze the incoming parameters to
respond to any form submitted ("respond").
Randal L. Schwartz
2009-08-30 22:46:40 UTC
Permalink
The heir apparent to the CGI::Prototype namespace should support
Class::Prototype-styled objects. Under the licensing terms of CGIP, you're
free to derive whatever you want and call it whatever you want, but please
reserve CGI::Prototype (or names close to it) for something that supports
prototype-inheritance objects. I have customers that are making use of the
Class::Prototyped features that are not classical class-instance structures,
so any "replacement" of CGIP with something new must be carefully considered.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<***@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
Terrence Brannon
2009-08-30 23:02:08 UTC
Permalink
Post by Randal L. Schwartz
The heir apparent to the CGI::Prototype namespace should support
Class::Prototype-styled objects.
Right. I'm not suggesting an heir apparent. I'm suggesting an additional
module in the distribution, along with associated test suite.
This module would extend on the other concept of "CGI Prototype" -
prototyping the CGI process. Not using CGI with prototyped objects.
Also, people tend to look down on modules whose release date is more
than 6 months old. It starts to look unmaintained.

I dont want to fork and start a separate distro, just add
CGI::Prototype::Moose to the CGIP distro.
Post by Randal L. Schwartz
I have customers that are making use of the
Class::Prototyped features that are not classical class-instance structures,
so any "replacement" of CGIP with something new must be carefully considered.
right and a toy example exemplifying the need for non classical
class-instance structures in the standard docs or a magazine article would
help greatly. I did talk to Jason Purdy above his negative CPAN ratings
review of CGIP <http://cpanratings.perl.org/dist/CGI-Prototype>.

He wrote his 'review' after skimming the docs. Now, I dont think that
what he did was fair or thoroughly researched, but I think a section in
the docs like "Why Another Framework" or "How is CGIP Different" would
go a long way towards stamping out superficial inspection of the module.
Randal L. Schwartz
2009-08-30 23:16:03 UTC
Permalink
Terrence> I dont want to fork and start a separate distro, just add
Terrence> CGI::Prototype::Moose to the CGIP distro.

And I'm saying that's the wrong name for that, if it's not about replacing all
of what CGIP already does, including prototype inheritance. Feel free
to release it as CGI::Moose or something.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<***@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Smalltalk/Perl/Unix consulting, Technical writing, Comedy, etc. etc.
See http://methodsandmessages.vox.com/ for Smalltalk and Seaside discussion
Loading...