Iterator Rewrite

I’m spending some time today to finish my revision of the Patterns for PHP: Iterator Pattern.

The first thing I have to do is remove the SPL information, which is done.

The next thing to do is create a PHP 4 example to reduce confusion.

The PHP 5 example is a little bit more involved and has a little bit more classes for the case study. I’m going to do User iteration to show how it can be accomplished in PHP 5. It won’t be the best example possible, but it will complete the Iterator Pattern.

Doing the Observer Pattern?

I think if I have time between today and tomorrow that I’ll work on the observer pattern or at least write up some parts of it to reference the Plugin Model. It will again reference the SPL way of doing the Observer.

Possibly Related Posts:


5 Comments.

  1. I sent a iterator php 5 example to you in php patterns site

  2. http://fipaj.livenet.pl/index.php/2006/06/22/iteratory/
    Here you are nice examples ;)
    Page is in Polish language, but I can translate for you, if you wish. But listings are versy simply, you can add them to Wiki.

    Wishes,
    Filip Konarowski

  3. Thanks!

    It is a good example and I think I’ll have to rewrite it since I’m not sure copying the examples would infringe on the sites copyright. I’m not going to do that.

    I think I’ll probably just link to the article and if the author wants to transfer it to the wiki, then he or she is more than welcome.

  4. My blog is on Creative Commons (I added copyrights to the footer), so you *can* copy its contents.

    I don’t think that linking to my blog is a good idea, because I write in Polish, not English, so readers won’t find anything useful on my site.

    Feel free to copy examples now – It’s a holiday time and in next three weeks I will be offline. Maybe later I will translate this article…

  5. Thanks! Awesome. I know enough PHP that I can write something up describing what you have. If you want to go in and correct me, then you can do so.

    I’ll probably have something done within the day. There are going to be three working examples, so the concept should be pretty clear.