Propel. DOA. Why?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • petermichaux@yahoo.com

    #1

    Propel. DOA. Why?

    Hi,

    I'd like to be convinced otherwise but I have been reading about Propel
    and similar packages and these packages seem like a waste of time.
    Quotes from the Propel site.

    "Propel makes applications easier to write"

    To use Propel there is a bunch of overhead to prepare by making an XML
    document describing the database. That seems like a real pain during
    development especially if the database is changing along the way.

    - - - -

    "Propel enables you to perform complex queries and database
    manipulations without writing a single SQL clause."....."T he Criteria
    class is able to build commonly used queries, but it does not pretend
    to be capable of building any query. In cases where you need to perform
    particularly complex queries you will need to write your own SQL
    statements. "

    First, why avoid SQL? I think it is the simplest part of a web app to
    read. Even a complicated query is still a small self-contained
    statement. Second, even if I want to use Propel to avoid SQL and if I
    have a complicated SQL query then I'll still have to write SQL.

    - - - -

    ///PROPEL CODE

    $cton1 = $c->getNewCriterio n(AuthorPeer::F IRST_NAME, "Leo",
    Criteria::NOT_E QUAL);
    $cton2 = $c->getNewCriterio n(AuthorPeer::L AST_NAME,
    array("Tolstoy" , "Dostoevsky ", "Bakhtin"),
    Criteria::IN);
    $cton1->addOr($cton2 );
    $c->add($cton1);

    $results = AuthorPeer::doS elect($c);
    foreach($result s as $author) {
    print "Author: " . $author->getLastName( ) . ", " .
    $author->getFirstName () . "\n";
    }

    ///SQL with PEAR DB

    $result = $db->getAll("SELE CT * FROM author WHERE first_name!='Le o' OR
    last_name IN ('Tolstoy', 'Dostoevsky', 'Bakhtin')");

    foreach($result s as $author) {
    print "Author: " . $author['last_name'] . ", " .
    $author['first_name'] . "\n";
    }

    ///To me the plain SQL with PEAR DB version is much easier to read.

    - - - - - -

    So what am I missing? People are spending a lot of time developing
    Propel. I don't get it.

    -Peter

Working...