Reworking DOMXML

From: Date: Thu, 19 Jul 2001 04:10:46 +0000
Subject: Reworking DOMXML
Groups: php.dev 
Request: Send a blank email to php-dev+get-60254@lists.php.net to get a copy of this message
There needs to be a decision made in order to complete the work on domxml, as it currently stands. I think it is a good idea to keep both the "procedural" and "object oriented" interfaces in the code. The way the module is currently written, it will take the least amount of work to just require the user to pass a valid XML object to the procedural calls. I would like to be consistent across the board on where we expect this object to be passed, and I see to ways to do it, each with their pro's and con's, so I thought I would ask for input before I went too much farther down the road I'm currently following. Style #1: The dom_document object is always the FIRST parameter to the function, if called as a procedure and NOT as a method on a dom_document object. Pro: This seems cleaner, as the user will ALWAYS know where the object belongs. Con: This might confuse the oop users, as the documentation does not currently clearly distinguish the two interfaces. Style #2: The dom_document object is always LAST. Pros: Simplest to implement with code as it currently stands. Seems to be the way many other functions have been written. Cons: User will have to remember all arguments of all functions and pass SOMEthing, even if that means passing NULLs or something. Position of dom_document becomes a moving target. Does anyone have any input? I'm currently leaning towards the 2nd style...

« previous php.dev (#60254) next »