What I not like is get_incoming as method for param.

Good question.

Lets look away from the Param plugin for a moment, and take a look at the httpheader plugin. With headers, there is a stage where the browser sends headers to the server, and there is a stage where the server sends headers to the browser. To accommodate all of these stages, the httpheader plugin offers the following methods:

  • get_incoming()

  • set_incoming()

  • get_outgoing()

  • set_outgoing()

    The Cookie plugin's interface is the same as the Httpheader one I just described.

    Now, lets look at the Params plugin again. You said that the get_incoming() did not seem intuitive. The reason it's like that though is to match the style of the HttpHeader and Cookie plugins. These two plugins couldn't just have a get() method, as they need to differentiate between incoming and outgoing parameters. So, to keep a like style, I named the methods in the Param plugin get_incoming and set_incoming. I feel that by having a like interface across the plugins, it would make OpenPlugin as a whole easier to learn.

    However, because get_incoming() does seem a bit long, I've been thinking about writing a wrapper function which would work a bit like CGI's or Apache::Request's param() function. Instead of using get_incoming or set_incoming, you could just use incoming(). Behind the scenes, it would call get_incoming or set_incoming based on the amount of parameters you send it. For example:
    # Retrieve incoming param (instead of using (get_incoming) $OP->param->incoming( 'param_name' ); # Set an incoming param (instead of using set_incoming) $OP->param->incoming( 'param_name', 'value' );
    Again, if I add this, both would still work. If you prefer using get_incoming/set_incoming, us them, if you prefer just using incoming(), you can use that.

    Any thoughts?

    -Eric

    --
    Lucy: "What happens if you practice the piano for 20 years and then end up not being rich and famous?"
    Schroeder: "The joy is in the playing."

    In reply to Re: Re: Request For Comment: Web Application Plugin Manager by andreychek
    in thread Request For Comment: Web Application Plugin Manager by andreychek

    Title:
    Use:  <p> text here (a paragraph) </p>
    and:  <code> code here </code>
    to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.