tag:blogger.com,1999:blog-7507983247248838078.post5673213331930127240..comments2023-05-06T05:05:36.512-07:00Comments on Pondering Object Oriented Design: Parameterized TypesCurtis Cooleyhttp://www.blogger.com/profile/13559671537311158727noreply@blogger.comBlogger1125tag:blogger.com,1999:blog-7507983247248838078.post-79593462414343387222011-02-27T09:41:17.927-08:002011-02-27T09:41:17.927-08:00In fact I often wondered if generics would be an u...In fact I often wondered if generics would be an useful addition for dynamic languages such as PHP. <br />PHP is not based on duck typing only, as it supports Java-like interfaces; but I often write code that would require generics in Java (for things like service or presentation layers) and I simply ignore granular interfaces in this case. <br />For example, I would create a SuperCoolSorter and type hint other classes using SuperCoolSorter, but ignore type safety for checking that a SuperCoolSorter of X objects is not used for sorting Y objects (since its configuration would be different, it may have a collaborator like XOrderStrategy).Giorgiohttps://www.blogger.com/profile/12689416577856305650noreply@blogger.com