Design-Patterns-Playground

Swift way to explore OO and functional design patterns

  • Owner: ilyabelikin/Design-Patterns-Playground
  • Platform:
  • License::
  • Category::
  • Topic:
  • Like:
    0
      Compare:

Github stars Tracking Chart

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.

Main metrics

Overview
Name With Ownerilyabelikin/Design-Patterns-Playground
Primary LanguageSwift
Program languageSwift (Language Count: 1)
Platform
License:
所有者活动
Created At2014-07-30 15:04:11
Pushed At2019-06-27 15:41:29
Last Commit At2019-06-27 23:41:29
Release Count0
用户参与
Stargazers Count39
Watchers Count4
Fork Count6
Commits Count53
Has Issues Enabled
Issues Count0
Issue Open Count0
Pull Requests Count0
Pull Requests Open Count1
Pull Requests Close Count0
项目设置
Has Wiki Enabled
Is Archived
Is Fork
Is Locked
Is Mirror
Is Private