the value in trees

29
THE VALUE IN TREES DREW MCCORMACK

Upload: drew-mccormack

Post on 22-Jan-2018

548 views

Category:

Software


0 download

TRANSCRIPT

Page 1: The Value in Trees

THE VALUE IN TREESDREW MCCORMACK

Page 2: The Value in Trees
Page 3: The Value in Trees
Page 4: The Value in Trees
Page 5: The Value in Trees

SKETCH

PROBLEMS

▸ Edits during saves

▸ Edits during rendering

▸ Fragile undo

Page 6: The Value in Trees
Page 7: The Value in Trees

SNAPSHOTTime

Page 8: The Value in Trees
Page 9: The Value in Trees
Page 10: The Value in Trees
Page 11: The Value in Trees

1.02.0

Page 12: The Value in Trees
Page 13: The Value in Trees

VALUE TYPES

PROS

▸ Stack memory

▸ No reference counting

▸ Safe between threads

▸ No changes behind your back

Page 14: The Value in Trees

struct Document {

var sections: [Section]

}

struct Section {

var paragraphs: [Paragraph]

}

struct Paragraph {

var style: ParagraphStyle

var content: String

}

Page 15: The Value in Trees

class ViewController {

var document: Document {

didSet {

self.reloadViews()

}

}

}

let c = ViewController()

c.document.sections[0].paragraphs[0].style = ...

Page 16: The Value in Trees

1.02.0

Page 17: The Value in Trees
Page 18: The Value in Trees

CAN I HAVE A VALUE STORE FOR XMAS?

Page 19: The Value in Trees

…AND CAN I HAVE IT SYNC?

Page 20: The Value in Trees

DISTRIBUTED VALUE STORE (DVS)

Page 21: The Value in Trees

DISTRIBUTED VALUE STORE (DVS)

Repository

Page 22: The Value in Trees

DISTRIBUTED VALUE STORE (DVS)

struct Person { var name = "Bob" var age = 32 var tags = ["clean", "smart"] }

Page 23: The Value in Trees

DISTRIBUTED VALUE STORE (DVS)

struct Person { var name = "Bob" var age = 32 var tags = ["clean", "smart"] }

CloudKit Repository

Page 24: The Value in Trees

DISTRIBUTED VALUE STORE (DVS)

struct Person { var name = "Bob" var age = 32 var tags = ["clean", "smart"] }

Page 25: The Value in Trees

github.com/mentalfaculty/impeller

Page 26: The Value in Trees

import Impeller

struct Person: Storable {

static let storedType = "Person"

var metadata = Metadata()

var name = "No Name"

var age: Int? = nil

...

Page 27: The Value in Trees

init?(readingFrom repository:ReadRepository) {

name = repository.read("name")!

age = repository.read(optionalFor:"age")!

}

func write(in repository:WriteRepository) {

repository.write(name, for: "name")

repository.write(age, for: "age")

}

Page 28: The Value in Trees
Page 29: The Value in Trees

ATTRIBUTION

IMAGES▸ Sketch Logo

▸ https://www.sketchappsources.com/free-source/2332-new-sketch-vector-icon.html

▸ Bamboo Forest

▸ https://www.pexels.com/photo/nature-forest-trees-bamboo-5091/

▸ Redwood Forest

▸ https://commons.wikimedia.org/wiki/File:Sequoia_sempervirens_Big_Basin_Redwoods_State_Park_4.jpg

▸ Notes

▸ http://www.cooperazionetrentina.it/Giovani/Iniziative/Iniziative-2015/I-giovani-e-la-cooperazione-che-cambia-7-edizione

▸ Crop Circles

▸ https://commons.wikimedia.org/wiki/File:CropCircleW.jpg

▸ iPhone

▸ https://commons.wikimedia.org/wiki/File:IPhone_with_icons.svg

▸ Database Icon

▸ https://pixabay.com/en/database-diagram-data-storage-disk-29954/

▸ Jedward

▸ https://www.flickr.com/photos/chiropractic/6849052778

▸ No cycling

▸ https://commons.wikimedia.org/wiki/File:Uruguay_Road_Sign_Bicycles_Only.svg

▸ Planting

▸ https://www.flickr.com/photos/usfsregion5/3598029211