Newsgroups: php.internals Path: news.php.net Xref: news.php.net php.internals:28621 Return-Path: Mailing-List: contact internals-help@lists.php.net; run by ezmlm Delivered-To: mailing list internals@lists.php.net Received: (qmail 74039 invoked by uid 1010); 27 Mar 2007 22:27:47 -0000 Delivered-To: ezmlm-scan-internals@lists.php.net Delivered-To: ezmlm-internals@lists.php.net Received: (qmail 74024 invoked from network); 27 Mar 2007 22:27:47 -0000 Received: from unknown (HELO lists.php.net) (127.0.0.1) by localhost with SMTP; 27 Mar 2007 22:27:47 -0000 Authentication-Results: pb1.pair.com smtp.mail=thefirstofall@gmail.com; spf=pass; sender-id=pass Authentication-Results: pb1.pair.com header.from=thefirstofall@gmail.com; sender-id=pass; domainkeys=bad Received-SPF: pass (pb1.pair.com: domain gmail.com designates 64.233.182.185 as permitted sender) DomainKey-Status: bad X-DomainKeys: Ecelerity dk_validate implementing draft-delany-domainkeys-base-01 X-PHP-List-Original-Sender: thefirstofall@gmail.com X-Host-Fingerprint: 64.233.182.185 nf-out-0910.google.com Linux 2.4/2.6 Received: from [64.233.182.185] ([64.233.182.185:30523] helo=nf-out-0910.google.com) by pb1.pair.com (ecelerity 2.1.1.9-wez r(12769M)) with ESMTP id 40/A1-52137-36A99064 for ; Tue, 27 Mar 2007 17:27:47 -0500 Received: by nf-out-0910.google.com with SMTP id l35so3579444nfa for ; Tue, 27 Mar 2007 15:27:43 -0700 (PDT) DKIM-Signature: a=rsa-sha1; c=relaxed/relaxed; d=gmail.com; s=beta; h=domainkey-signature:received:received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=fxXKEnZLzUFBv2HWEG9hgapX1kdEfusbIwoP2hqaAU0t9aeI0VjVcsBzBdtzQxWX5+kXCxo8VHTC+Ayse6EDSmhxsRYZvFyBO79TNWiUbmhsOjrJwOgHr1HQsm/XeJQjjyzs5Z3bxpZCf5E+jrOGKfpdVFRS9rslbmFZlAbcIrc= DomainKey-Signature: a=rsa-sha1; c=nofws; d=gmail.com; s=beta; h=received:subject:from:to:cc:in-reply-to:references:content-type:date:message-id:mime-version:x-mailer:content-transfer-encoding; b=Kt2dLWU/l2thexzKb4g4DyuqXfZDvDFbM2DnuzIo3Nj9smXoNAk8fPrzKKT/y1bzvMOmPMbpXIa9wuvgVqqrdVt5Yka28CZIZNJkIarqr5wIcUq9jurMNLG8Um95SWOJoHKpS87MRT/LQxsBnxHZnpc80vTfbs+CU0znmg1mBjk= Received: by 10.82.163.13 with SMTP id l13mr17273473bue.1175034463288; Tue, 27 Mar 2007 15:27:43 -0700 (PDT) Received: from ?192.168.128.205? ( [83.216.49.206]) by mx.google.com with ESMTP id e9sm27743976muf.2007.03.27.15.27.41; Tue, 27 Mar 2007 15:27:41 -0700 (PDT) To: Jeff Moore Cc: internals@lists.php.net In-Reply-To: References: <1174134488.8667.33.camel@lena> <45FC74A5.6080307@pooteeweet.org> <1174231834.12274.110.camel@lena> <45FEBD70.2090000@zend.com> <1174330743.9134.2.camel@lena> <41721.216.230.84.67.1174341117.squirrel@www.l-i-e.com> <1174342387.14657.86.camel@lena> <46004829.7080200@pooteeweet.org> Content-Type: text/plain; charset=utf-8 Date: Wed, 28 Mar 2007 00:27:39 +0200 Message-ID: <1175034459.10691.27.camel@lena> Mime-Version: 1.0 X-Mailer: Evolution 2.10.0 Content-Transfer-Encoding: 8bit Subject: Re: [PHP-DEV] google SoC - dbobj From: thefirstofall@gmail.com (Adam Banko) 2007. 03. 27, kedd keltezéssel 16.55-kor Jeff Moore ezt írta: > > Hi, > > Sorry, I'm coming to this discussion a bit late and perhaps I don't > understand the all issues, but I think the scope of creating an ORM > for PHP is probably too large. Let me suggest a smaller project that > could lead to better ORM. Yes a bit late ... as the application submission deadline has already passed. (for SoC) > PHP has several methods of serializing and unserializing objects to > different formats: > > PHP serialization format using serialize/unserialize (with __sleep, > __wakeup and the Serializable interface) > PHP code using var_export and eval (with __set_state) > JSON using json_encode and json_decode > Partial support for DB Records using mysql_fetch_object or > PDOStatement->fetchObject() > > Its safe to assume that other serialization formats are possible. > > All of these methods have to address the same issues with objects: > > How to handle protected and private properties? > To call or bypass the constructor on unserialization? > Can objects become involved with their own serialization? (such as > __sleep, __wake, __set_state, and Serializable) > Must objects become involved with their own serialization (such as > with var_export and __set_state) or can you serialize unaware objects? > Are object relationships and identity preserved? (only true for > serialize/unserialize right now) > How are classes loaded? (unserialize_callback_func and __autoload?) > > I think a more limited scope project would be to attempt to address > these core object serialization issues across the multiple formats > that PHP already provides in some consistent way. Of course, not > every capability is possible or necessary with every format. The SoC application is over, but this could also be done outside of SoC. I think this is a good project, rethinking the serialization / unserialization support in PHP would be beneficial for many. However don't wait for me to do it, because I won't. > Before implementing ORM in C, which would be relatively less flexible > than a PHP implementation, perhaps it would be a good idea to profile > the existing PHP ORM solutions and look for opportunities to > implement key functions in C, while leaving the majority to user space. I think I've already explained my opinion on this idea. Your idea is not bad, and I think many agrees with you, but I see things a bit differently. > A possible example of such an opportunity might be some equivalent to > extract() and compact() only for converting between arrays and object > properties instead of arrays and local variables. I generally don't like the idea of converting an object to array and back as it violates most OO principles. Don't convert an object to an array, because than there's no problem with private properties and so on. If someone wants arrays from the database, then he/she souldn't use ORM because it's Object-relational mapping, not Array-relational mapping! > Rather than implement a full blown ORM extension, perhaps > implementing some object serialization enhancements would be a good > alternative, or at least a good first step? Perhaps some user space > ORM profiling would be a good way to find the second step? Maybe ... but that is someone else's project, not mine. To see what my goals are how I plan to achieve them, see the archives. I think I've explained a lot on the list. However, if you find any problems with my proposed solution, please don't hesitate to share it with us. > > Best Regards, > > Jeff > Thank you, Adam