Matthew Weier O’Phinney
commented on
Zend Framework Tutorial, ZendCon 2009Just a note: when you hit the slides that are marked "Step X" -- you’ve hit about the 1 hour mark of a 3 hour tutorial. The remainder of the slides are placeholders, and simply indicate the next step in a hands-on demonstration where we built a pastebin application.2 months ago
Matthew Weier O’Phinney
commented on
Play-Doh: Modelling Your ObjectsRelational mapping is very difficult, and was way beyond the scope of this presentation. The primary purpose of the presentation was to get PHP developers to start thinking beyond the RDBMS and instead focus on the objects they’re manipulating. I mention ORMs briefly within this presentation as they can be used to solve some of the problems of persisting your models (though since ORMs are typically RDBMS-specific, they do not answer the question of persisting through document databases or web services) -- but there was no time to go into detail on that subject.
As for save() vs. insert()/update(), save() is used in many ORMs, ActiveRecord, and Table Data Gateway implementations because it simplifies the interface. You do not need to know how the object was instantiated -- i.e., was it loaded from the persistence store, or is it a newly created object -- you simply save() it. save() then does the introspection of the object for you and decides if it is an update() or insert() operation -- and when done, updates the object from the persistence store.3 months ago
Matthew Weier O’Phinney
commented on
Play-Doh: Modelling Your Objects@David: There are two approaches: duck typing and interfaces. Interfaces are the more classic approach, and in such an approach, the decorator would implement the interface, and in most instances simply proxy calls back to the mapper being decorated (except when modifying functionality). This approach enforces contracts -- but makes the actual implementation more verbose (no more relying on __cal()).
In duck typing, the idea is that we wouldn’t type hint for the object, but instead let the language enforce the interface. In other words, if we call a method not available on the object, PHP barfs. This approach offers more flexibility and is typically more concise, but can lead to difficulties in debugging and maintenance.3 months ago
Matthew Weier O’Phinney
commented on
Zend Framework WorkshopIf you like these, you should read those done for the 2009 DPC, as they are current through ZF 1.8: http://www.slideshare.net/weierophinney/zend-framework-workshop-dpc094 months ago
Matthew Weier O’Phinney
commented on
Practical SVN for PHP Developers@guest75d934f1: feature branches and/or developer branches are where unstable commits should go. However, as @guestc4db8b notes, this is also where using a distributed VCS alongside SVN can be incredibly useful -- and I cover that in my "Git + SVN: A Match Made in ?" presentation (also up here on slideshare). I will often create a local branch in git for experimentation that I know may be unstable, and then merge only the completed feature to my main branch -- which gets pushed to SVN.
BTW, merges in SVN are not difficult at all, and that’s one of the myths we were trying to dispel with this talk.6 months ago
Comments