Comments for "Net_GPS"

» Submit Your Comment
Comments are only accepted during the "Proposal" phase. This proposal is currently in the "Finished" phase.
» Comments
  • Philippe Jausions  [2008-04-19 16:02 UTC]

    This is a bit confusing, at least to me. Probably partly because I am not well aware of the mobile offers in Japan.

    That being said, could you detail a little bit more about how the package would work? From what I gather:

    1. The browser on the mobile device would connect to a web site using the package.
    2. The package would know what type of device this is, and apparently could determine the carrier from the User Agent HTTP header (with the use of the Net_UserAgent_Mobile package)
    3. The package would somehow know where to go to get the mobile's GPS location (that's where I'm lost)

    Otherwise, several things:
    - New PHP4-compatible packages are not accepted in PEAR anymore, so please correct to use public/private/protected scope keyword (update file docBlock for the PHP version)
    - getGPSResponse() assumes that "lat" and "lon" are passed in the URL ($_GET). Why is that?
    - You probably meant "dispatch" in the name of your methods instead of "dispath"
    - What is "setEasy" used for?
    - I wouldn't return the tag part in getGPSLink(), but simply the URL only. It keeps the API much simpler and not try to mess with HTML formatting. What is the link used for anyway?
    - How one knows the the $url parameter to provide in getGPSLink() ?
    - No parens should be around the switch's case. (Run PHP_CodeSniffer on your code) (getGPSResponse())
    - If the same logic is used for both self::SOFTBANK_3GC, and self::SOFTBANK_3GC_EASY you don't need to duplicate the whole "case", just don't put the "break" for the first one. (getGPSResponse())
    - self::DOCOMO_MOVA doesn't return an array with lat/lon indexes in getGPSResponse() as is returned with the other cases.
    - The name of the package "Net_GPS" doesn't seem right, but I can think of an alternative.
    - The architecture of the package is not very extensible to easy add new providers.
  • Horikita Kei  [2008-05-06 07:15 UTC]

    Hi, Philippe
    Thank you very much for a lot of advice!

    > how the package would work? ...
    4. The package creates a link to GPS location server with a CGI url to return from the GPS server and parse the response.
    (The web site owner put the link on his site and a visitor click it.)
    (Then a request occurs to GPS server and a response occurs from it with location informaiton.)
    5. In the CGI, this package absorb the difference of the format with the carrier and parse the location informaiton.

    I answer it for your advice.
    > - New PHP4-compatible ...
    - I changed my package to PHP5 and fixed the scope and comment.

    > - getGPSResponse() assumes ...
    - parsing the response from the GPS location server.

    > - You probably meant ...
    - I fixed the spell ('dispatch').

    > - What is "setEasy" ...
    - I deleted the function ('setEasy').

    > - I wouldn't return the tag part ...
    - The link to GPS location server is very complicated. (like "lcs" <a href='x.com' lcs>get location</a>). So I want to provide two returns. URL is for 'form tag'.

    > - How one knows the ...
    - A site owner appoints the $url to parse the response from GPS server.

    > - No parens should be ...
    - I deleted parens in switch's case.

    > - If the same logic is used for ...
    > - The architecture of the package ...
    - I separated the GPS class and provider class for extensible and logic.

    > - self::DOCOMO_MOVA ...
    - I fixed the logic.

    > - The name of the package "Net_GPS" ...
    - I do not persist in a name,,but there is not good ideas. "HTML_GPS" or "Net_Mobile_GPS"?
    please give me advice, everybody.

    Thanks,