<html><head><meta http-equiv="Content-Type" content="text/html charset=utf-8"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class="">(Reposting because I forgot to change the subject line. Hope that this is the correct thing to do.)</div><div class=""><br class=""></div>I have to say John that I am not a fan of your OOP code. I would have written the OOP code very much like you wrote the POP version using the Strategy pattern.<br class=""><div><div style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space;" class=""><div class=""><br class=""></div><div class=""><div class=""><font face="Monaco" class="">[Animal]<*>--->[Mode]</font></div><div class=""><font face="Monaco" class=""> ^</font></div><div class=""><font face="Monaco" class=""> |</font></div><div class=""><font face="Monaco" class=""> +------+------+</font></div><div class=""><font face="Monaco" class=""> | | |</font></div><div class=""><font face="Monaco" class=""> [Land] [Sea] [Air]</font></div><div class=""> </div></div><div class=""><br class=""></div><div class="">(View the above with a mono-spaced font.)</div><div class=""><br class=""></div><div class="">In essence, I see no difference. There may be a difference, but I don’t think your example presents one.</div><div class=""><br class=""><div class=""><blockquote type="cite" class=""><div class="">On Feb 15, 2016, at 1:00 PM, <a href="mailto:swift-users-request@swift.org" class="">swift-users-request@swift.org</a> wrote:</div><br class="Apple-interchange-newline"><div class=""><div class="">Date: Sun, 14 Feb 2016 18:59:05 -0500<br class="">From: Jon Hoffman <<a href="mailto:hoffman.jon@gmail.com" class="">hoffman.jon@gmail.com</a>><br class="">To: swift-users <<a href="mailto:swift-users@swift.org" class="">swift-users@swift.org</a>><br class="">Subject: [swift-users] Comparing POP to OOP<br class="">Message-ID: <<a href="mailto:5DA5F8F5-D645-4BF9-A0CE-1AF1DB8B3735@gmail.com" class="">5DA5F8F5-D645-4BF9-A0CE-1AF1DB8B3735@gmail.com</a>><br class="">Content-Type: text/plain; charset="utf-8"<br class=""><br class="">Numerous tutorials that I have seen take a very Object-Oriented approach to the protocol-oriented programming (POP) paradigm. By this statement I mean that they tell us that with POP we should begin our design with the protocol rather than with the superclass as we did with OOP however the protocol design tends to mirror the superclass design of OOP. They also tell us that we should use extensions to add common functionality to types that conform to a protocol as we did with superclasses in OOP. While protocols and protocol extensions are arguably two of the most important concepts of POP these tutorials seem to be missing some other very important concepts. <br class=""><br class="">In this post I would like to compare Protocol-Oriented design to Object-Oriented design to highlight some of the conceptual differences. You can view the blog post here: <a href="http://masteringswift.blogspot.com/2016/02/pop-and-oop.html" class="">http://masteringswift.blogspot.com/2016/02/pop-and-oop.html</a> <<a href="http://masteringswift.blogspot.com/2016/02/pop-and-oop.html" class="">http://masteringswift.blogspot.com/2016/02/pop-and-oop.html</a>><br class=""><br class="">Jon<br class=""></div></div></blockquote></div><br class=""></div></div></div><br class=""></body></html>