The Artima Developer Community
Sponsored Link

PHP Buzz Forum
19 VersionControl_SVN review 15

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Alan Knowles

Posts: 390
Nickname: alank
Registered: Sep, 2004

Alan Knowles is Freelance Developer, works on PHP extensions and PEAR.
19 VersionControl_SVN review 15 Posted: Sep 23, 2004 8:03 AM
Reply to this message Reply

This post originated from an RSS feed registered with PHP Buzz by Alan Knowles.
Original Post: 19 VersionControl_SVN review 15
Feed Title: Smoking toooo much PHP
Feed URL: http://www.akbkhome.com/blog.php/RSS.xml
Feed Description: More than just a blog :)
Latest PHP Buzz Posts
Latest PHP Buzz Posts by Alan Knowles
Latest Posts From Smoking toooo much PHP

Advertisement
a87 I've been having a little attempt revamping my subversion viewer, seeing if I can
  1. Integrate it into the new site
  2. Use VersionControl_SVN, rather than the quick hack I wrote, Subversion_Stream.
I have to admit, though, the API for VersionControl is not exacly clean and user friendly. This is a general overview of the gripes.

  • Uses PEAR_ErrorStack, which hides errors, even worse than PEAR_Error used to.. DataObjects uses a ErrorStack style system, you can print_r the dataobject, and it shows you the last error as a propery of the object... (simple).

    Error stack seems to insist on you loading it, then only using it's methods to check stuff. - the actually error is hidden away in the stack object..

    Trouble is, that a number of the functions in DataObjects needed to return true/false (fetch, for example), so returning an PEAR_Error, was problematic then (in hindsight, alot of the other methods should have returned PEAR_Error, but that broke BC - and in the future it should throw exceptions).
    So, DataObjects had some logical justification for messing with the standard a little, VersionControl_SVN hasnt really, and it just adds a dependancy on a eventually redundant package.


  • Trying to make things easy ending up with a messier API,

    $x = VersionControl_SVN::factory(array('list','cat'), $options);
    $x->list->run()....

    while this is cute, it adds an horrific amount of complexity to the API, and only saves you a little bit of typing, at the expense of clarity and readibility.

  • Counterintuative program flow.

  • class VC_SVN {
    .... function run() {
    ....... $this->prepare();
    ....... exec in here..
    ....... $this->parseOutput();
    }

    VC_SVN_List extends VC_SVN {
    ..... function prepare() {

    So you call run on the base class, and the body of what happens is in the extended class. - so if you look at the 'action' classes, it is impossible to follow the flow of the application, without having a perfect memory of the base class..

    it would have been far better to have a run method in each action class, and call some generic methods from the base class.







20

Read: 19 VersionControl_SVN review 15

Topic: Linuxtag - Day 3 Previous Topic   Next Topic Topic: In Toronto for php|works

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use