SlideShare is now on Android. 15 million presentations at your fingertips.  Get the app

×
  • Share
  • Email
  • Embed
  • Like
  • Save
  • Private Content
 

Play-Doh: Modelling Your Objects

by Project Lead, Zend Framework at Zend Technologies, Ltd. on Jul 24, 2009

  • 22,056 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.

Statistics

Views

Total Views
22,056
Views on SlideShare
21,098
Embed Views
958

Actions

Likes
36
Downloads
284
Comments
4

26 Embeds 958

http://disole.wordpress.com 472
http://doriangray.com.ua 146
http://www.slideshare.net 70
http://victimofbabylon.com 37
http://www.webcreator.kiev.ua 36
http://bradley-holt.blogspot.com 34
http://shinazana.wordpress.com 29
http://www.webcreator.kiev 24
http://ignar.name 22
http://blog.ignar.name 20
http://mvc-in-php.blogspot.com 16
http://blog.meshin.ru 15
http://bradley-holt.com 6
http://bradley-holt.com 6
http://mvc-in-php.blogspot.ru 5
http://bradley-holt.blogspot.in 4
http://coderwall.com 4
http://victimofbabylon.posterous.com 3
http://localhost 2
http://bradley-holt.blogspot.de 1
http://static.slideshare.net 1
http://translate.googleusercontent.com 1
https://twitter.com 1
http://74.125.19.132 1
http://bradley-holt.blogspot.ch 1
http://www.thewebhatesme.com 1
More...

Accessibility

Upload Details

Uploaded via SlideShare as OpenOffice

Usage Rights

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

Report content

Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel

14 of 4 previous next Post a comment

  • dstockto David Stockton, VP of Technology 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
    4 years ago
    Are you sure you want to
    Your message goes here
    Processing…
  • 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.
    4 years ago
    Are you sure you want to
    Your message goes here
    Processing…
  • dstockto David Stockton, VP of Technology 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
    4 years ago
    Are you sure you want to
    Your message goes here
    Processing…
  • guestcebb8d5 Саша Стаменковић Nice lesson about 'Modelling Your Objects' 4 years ago
    Are you sure you want to
    Your message goes here
    Processing…
Post Comment
Edit your comment

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