• Email
  • Like
  • Save
  • Private Content
  • Embed
 

Play-Doh: Modelling Your Objects

by on Jul 24, 2009

  • 20,163 views

Updated version of my tek09 uncon talk, covering the pitfalls of standard database-driven development and ways to apply design patterns to make your code more maintainable, extensible, and flexible.

Updated version of my tek09 uncon talk, covering the pitfalls of standard database-driven development and ways to apply design patterns to make your code more maintainable, extensible, and flexible.

Accessibility

Categories

Upload Details

Uploaded via SlideShare as OpenOffice

Usage Rights

CC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike LicenseCC Attribution-NonCommercial-ShareAlike License

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate. If needed, use the feedback form to let us know more details.

Cancel

22 Embeds 847

http://disole.wordpress.com 445
http://doriangray.com.ua 131
http://www.slideshare.net 70
http://victimofbabylon.com 37
http://bradley-holt.blogspot.com 34
http://shinazana.wordpress.com 27
http://ignar.name 22
http://blog.ignar.name 20
http://mvc-in-php.blogspot.com 15
http://blog.meshin.ru 15
http://bradley-holt.com 6
http://bradley-holt.com 6
http://coderwall.com 4
http://mvc-in-php.blogspot.ru 3
http://victimofbabylon.posterous.com 3
http://bradley-holt.blogspot.in 2
http://localhost 2
http://bradley-holt.blogspot.de 1
http://translate.googleusercontent.com 1
http://static.slideshare.net 1
http://74.125.19.132 1
https://twitter.com 1

More...

Statistics

Likes
34
Downloads
273
Comments
4
Embed Views
847
Views on SlideShare
19,316
Total Views
20,163

14 of 4 previous next Post a comment

  • dstockto David Stockton, Director of Software Engineering at i3logix @Matthew Thank you for the quick response. In the slides presented, I am trying to figure out which was implied (duck typing or interface). The constructor of the decorators used type hinting of the decorated class, but that type hint was the actual class type. In that case, if I were to write another decorator for the same object, I would not be able to decorate a decorated object.

    Also would the idea with the slide example be that there's a __call() implementation that sends any unrecognized calls into the decorated object?

    Thanks again,
    David
    3 years ago
    Are you sure you want to
  • weierophinney Matthew Weier O'Phinney, Project Lead, Zend Framework at Zend Technologies, Ltd. @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 years ago
    Are you sure you want to
  • dstockto David Stockton, Director of Software Engineering at i3logix In the decorator examples, you're using type hinting to ensure you get a PersonMapper or Person class passed into the constructor. However the decorating classes themselves don't meet that same type hint. How would you be able to do something like give the mapper the ability to log information as well as cache the database call?

    It seems like the decorators would either need to extend the base class (probably wrong), or the PersonMapper and the CachingPersonMapper would need to both implement some interface and that interface would need to be the type hint for the constructor of the decorator?

    Any insight you can provide would be very appreciated. I've been showing this to lots of coworkers but we have all been tripped up by the decorator example.

    Thanks,
    David
    3 years ago
    Are you sure you want to
  • guestcebb8d5 Саша Стаменковић Nice lesson about 'Modelling Your Objects' 3 years ago
    Are you sure you want to
Post Comment
Edit your comment

Play-Doh: Modelling Your Objects Play-Doh: Modelling Your Objects Presentation Transcript