 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Benjamin Eberlei: Doctrine and SOLID
by Chris Cornutt February 05, 2013 @ 11:09:33
Benjamin Eberlei has a new post to his site today answering a question he sometimes gets about using Doctrine2 in a SOLID context (more on SOLID development here) as it seems difficult to follow the Single Responsibility Principle with how the tool is used.
These problems are related to the inability to share behavioral code through aggregation and the complexity of state transformations. Combining both, your average entity with 5-15 fields can end up with hundrets or thousands lines of code. The solutions to both problems boil down to minimizing duplication and maximizing clarity.
He looks at two different kinds of objects Doctrine uses in its setup, the value objects and method objects, and "maximize clarity" on them by dividing them up into more functional-related objects, passed into each other via method injection.
voice your opinion now!
doctrine value method objects clarity solid development principles
Devis Lucato's Blog: Anonymous objects in PHP - Composition, Mocks, Refactoring
by Chris Cornutt November 23, 2010 @ 13:17:53
In a new post to his blog Devis Lucato points out something he noticed when working with objects and anonymous functions/closures - they're not all as they seem.
Both solutions allow to instantiate an anonymous object with properties. They are used as value objects and have no other purpose than storing values, so no logic can be included and they don't come with methods. They can be used as function parameters instead of arrays, for instance. PHP 5.3.0 introduced anonymous functions and closures, so it is now possible to attach functions to these VOs (*). [...] The first thing to notice is that these properties are not methods but callable functions:
In his example, an anonymous function dynamically appended to an object doesn't have access to a property set on the object just one line before. There's a way around it with call_user_func, but it's not practical. His proposed solution is to create a type of Anonymous class that uses the __call method to catch the methods and translate them into calls to call_user_func_array automatically.
voice your opinion now!
anonymous objects composition mocking refactoring
Zend Developer Zone: Book Review Learning PHP Data Objects
by Chris Cornutt December 28, 2007 @ 07:58:00
The Zend Developer Zone has posted a review of Packt Publishing's "Learning PHP Data Objects" book writen up by Akash Mehta.
In Learning PHP Data Objects, the author Dennis Popel examines this new [database access] system and explains how to begin using PDO in development as a replacement for typical database drivers. The book is an excellent introduction to the data abstraction layer and also provides essential insight into the inner workings of database interaction with PHP.
Akash talks briefly about the history of PDO and what it can be used for first, then gets into the contents of the book (things like the intro chapters and the quality of the writing). The thing he thinks makes the bok stand out, though, is the examples and sample code that reflect both simple methods and more complex issues PDO developers might run into.
voice your opinion now!
book review learning data objects pdo dennispopel packt book review learning data objects pdo dennispopel packt
Jacob Santos' Blog: Why SDO Doesn't Take Off
by Chris Cornutt August 24, 2006 @ 08:47:09
In his latest, Jacob Santos asks the question more and more people are wanting to know - why hasn't SDO really taken off?
Developers will eventually start using it, it will take some time to go from the PHP way to SDO way. It would be easier to jump into SDO once better, more easily interpreted and simple to understand tutorials, code samples, and support is available. IBM tutorials are a little bit technical, with words and complex pictures (UML). Just give me code and explain how it works and let me run with the SDO scissors in my hand.
He talks about the contributions that both Zend and IBM have made to the effort and the lack of features (well, the duplication of current PHP features - XML and database functionality). He has a positive outlook for the overall future of the project, stating that:
I'm quite sure that enough PHP developers are going to embrace SDO in the coming years depending on the coverage it gets that IBM and Zend's investment will pay off in the end.
voice your opinion now!
sdo service data objects xml database support future positive sdo service data objects xml database support future positive
Wez Furlong's Blog: SDO, SOA, TLA?
by Chris Cornutt August 15, 2006 @ 07:24:40
Wez Furlong asks today for any kind of feedback he can get from readers about the Service Data Objects functionality in PHP, specifically questions you might have about them.
One of the things that was apparent was that this SDO stuff has quite a high barrier to entry--too many three letter acronyms for starters, and its origins in the C++ and Java world don't help make it very accessible to the typical PHP developer.
Wez references two articles over on the Zend Developer Zone as great places to get started. He also mentions giving some feedback to the IBM folks about the SDO extension:
If you've wondered what this SDO stuff is all about, please read through those articles. After having done that, if theres something you're not clear on, or if everything is clear, or if you have some other thoughts on the matter, then please take a moment to send your feedback to Graham Charters (you'll find his email address on the top of the articles).
voice your opinion now!
service data objects article ibm extension feedback question service data objects article ibm extension feedback question
|
Community Events
Don't see your event here? Let us know!
|