Design-Patterns-Playground

Swift way to explore OO and functional design patterns

  • 所有者: ilyabelikin/Design-Patterns-Playground
  • 平台:
  • 许可证:
  • 分类:
  • 主题:
  • 喜欢:
    0
      比较:

Github星跟踪图

Design Patterns Playgrounds in Swift

These are small examples I made in Swift playgrounds while studying common patterns in software development.

Playgrounds names

Playgrounds with just pattern name are cononical implementations form the course. Some have additional versions like State Machine - Native (see below).

State Machine and State Machine - Native are best examples so far.

Reference materials

Course: Object-Oriented Design with Simon Allardice

Course: Design Patterns with Elisabeth Robson and Eric Freeman

Blog Post: Immutable Swift

"A truth that all programmers know: state management is why we get paid."

Blog post: Singleton Considered Stupid by Stevey Drunken

"The problem is, about 1/3 to 1/2 of them were basically cover-ups for deficiencies in C++ that don't exist in other languages. Although I'm not a huge Perl fan anymore, I have to admit the Perl community caught on to this first (or at least funniest). They pointed out that many of these so-called patterns were actually an implementation of Functional Programming in C++.

The Visitor, for instance, is just a class wrapper for a function with some accumulator variables, something that's achieved far more cleanly with, say, the map() function in higher-level languages. Iterator is a poor man's Visitor. The Strategy pattern is beautiful on the surface, but Strategy objects are typically stateless, which means they're really just first-order functions in disguise. (If they have state, then they're Closures in disguise.) Etc. You either get this, because you've done functional programming before, or you don't, in which case I sound like I'm a babbling idiot, so I guess I'll wrap it up."

Book: Head First Design Patterns

Book: Functional Programming in Swift

More Playgrounds

Design Patterns implemented in Swift – a better collection.

主要指标

概览
名称与所有者ilyabelikin/Design-Patterns-Playground
主编程语言Swift
编程语言Swift (语言数: 1)
平台
许可证
所有者活动
创建于2014-07-30 15:04:11
推送于2019-06-27 15:41:29
最后一次提交2019-06-27 23:41:29
发布数0
用户参与
星数39
关注者数4
派生数6
提交数53
已启用问题?
问题数0
打开的问题数0
拉请求数0
打开的拉请求数1
关闭的拉请求数0
项目设置
已启用Wiki?
已存档?
是复刻?
已锁定?
是镜像?
是私有?