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?
已存檔?
是復刻?
已鎖定?
是鏡像?
是私有?