in reply to RFC: API for declarative parameterized web queries

hi smls

your three requirements for encapsulation, declaration and reusability, would suggest to me for an object orientated interface. I am not convinced that overloading the global symbol space would really help with remaining encapsulated.And what you describe here sounds a lot like what Export is doing when you import the register_query routine. So are you in effect calling import for each query you register? Rather than for the class interface, then calling methods from the class on each query, which would adhere to the reusability and declaritve requirements too.

As the query is in a hash format, I would look at making the register_query as a constructor, something like my $rq = RQS->new; then go on to load the query object. your module needs to do the work to define the methods you would then call to set up each specific query and the execution methods.

In summary, I think the interface is a little muddled. You start off functionally, but then create objects on top of a functional interface. The well known Module CGI is a classic as it provides both interfaces so is worth a bit of study. I think you would be best to choose either functional, or object orientated. Or do something like CGI which offers either interface. I am not so sure about trying to implement both interfaces through one request though.

Others have suggetsed modules similar to yours to look at, admittedly CGI is a monolith. They may not do what you are trying to do in terms of use, but they may provide you with some implementation hints, closer to your interface model.

In terms of what you are describing, the use of this module would certainly help you, so no reason not to follow up with it, and usually if you have need for something, others may well also too.


My other OS is a gateway!