Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Data model mal anders

273 views

Published on

Gehalten auf Macoun 2017

Published in: Education
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • DOWNLOAD FULL BOOKS, INTO AVAILABLE FORMAT ......................................................................................................................... ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. PDF EBOOK here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. EPUB Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... 1.DOWNLOAD FULL. doc Ebook here { https://tinyurl.com/y6a5rkg5 } ......................................................................................................................... ......................................................................................................................... ......................................................................................................................... .............. Browse by Genre Available eBooks ......................................................................................................................... Art, Biography, Business, Chick Lit, Children's, Christian, Classics, Comics, Contemporary, Cookbooks, Crime, Ebooks, Fantasy, Fiction, Graphic Novels, Historical Fiction, History, Horror, Humor And Comedy, Manga, Memoir, Music, Mystery, Non Fiction, Paranormal, Philosophy, Poetry, Psychology, Religion, Romance, Science, Science Fiction, Self Help, Suspense, Spirituality, Sports, Thriller, Travel, Young Adult,
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here
  • Be the first to like this

Data model mal anders

  1. 1. Macoun ⌘
  2. 2. Data Model Mal anders Maxim Zaks @iceX33
  3. 3. Ablauf •Philosophie •Vorstellung von Entitas-Kit •Ausblick
  4. 4. Worum geht es beim Programmieren?
  5. 5. EDV = Elektronische Datenverarbeitung
  6. 6. Zwei Arten von Datenverarbeitung?!
  7. 7. Reine Berechnung = Datentransformation/Erzeugung
  8. 8. Reine Berechnung •Gegebener Datensatz •Transformation-Regelwerk •Ergebnis
  9. 9. Compiler Zustandslose WebServices Funktionale Programmierung
  10. 10. Was ist mit Web Browser und Apps?
  11. 11. HTML, CSS & JS rein Pixelwolke raus
  12. 12. Interaktive Berechnung
  13. 13. Interaktive Berechnung •Vorheriger Zustand + (User) Eingabe •Transformation-Regelwerk •Zwischenergebnis
  14. 14. Die Berechnung wird in einer Schleife durchgeführt
  15. 15. Apps Spiele Simulationen
  16. 16. Die Zwischenergebnisse werden in Datenmodell gespeichert
  17. 17. Welche Art von Daten gibt es?
  18. 18. Datenarten •Applikationsbezogene Daten •Nutzergenerierte Inhalte •Laufzeit relevante Daten / Applikationszustand
  19. 19. Applikationszustand mit OOP
  20. 20. Metapher basiert •Ein Bankkonto •Eine Person •EinVertrag
  21. 21. Geht es auch mehr Datenorientiert?
  22. 22. Datenorientiert •DE22100100500123456789 - IBANComponent •Maxim Zaks - NameComponent •XC45332FGD - ContractIdComponent
  23. 23. Class vs. Entity
  24. 24. Eine gute Klasse •Versteckt Daten (encapsulation) •Bündelt verhalten (cohesion) •Ist SOLID •Single responsibility | Open/Closed | Liskov substitution | Interface segregation | Dependency inversion
  25. 25. Eine Entity •Bündelt beliebige Komponenten •Hat keinVerhalten •Ist auffindbar (querable) •Kann observiert werden
  26. 26. let ctx = Context() let e = ctx.createEntity() e += NameComponent(value: “Maxim Zaks”) e += IBANComponent(number: “DE22100100500123456789”) print(e.get(NameComponent.self)?.value) //Optional(“Maxim Zaks”) e.with { c: IBANComponent in print(c.number) // DE22100100500123456789 }
  27. 27. Context verwaltet Entities
  28. 28. Komponente ist ein Struct, der `Component` oder `UniqueComponent` implementiert
  29. 29. Entity ist ein Wrapper um [CID: Component]
  30. 30. Eine Entity ist definiert durch ihre innere Werte Nicht durch ihre Geburt
  31. 31. Entities können anhand ihrer Komponenten gefunden werden
  32. 32. let group = ctx.all([A.cid, B.cid], any: [C.cid, D.cid], none:[E.cid]) for e in group { print(e.has(A.cid))) // true } group.withEach { e, c: A in print(c) e -= A.cid } print(group.count) // 0
  33. 33. Group ist eine Sequenz von Entity die immer aktuell ist
  34. 34. Implizite und explizite Entity Klassifizierung
  35. 35. struct Name: Component { let value: String } struct BirthDay: Component {let value: Date } struct NumberOfEmployees: Component {let value: Int} struct Address: Component {let value: String} let personMatcher = Matcher(all:[Name.cid, BirthDay.cid]) let organisationMatcher = Matcher(all:[Address.cid], none:[BirthDay.cid]) let people = ctx.group(personMatcher) let organisations = ctx.group(organisationMatcher)
  36. 36. Implizite Klassifizierung durch all, any, none Regeln angewandt an Daten
  37. 37. Explizite Entity Klassifizierung?
  38. 38. struct Person: Component {} struct Organisation: Component {} let personMatcher = Person.matcher let organisationMatcher = Organisation.matcher let people = ctx.group(personMatcher) let organisations = ctx.group(organisationMatcher)
  39. 39. Explizite Entity Klassifizierung durch “TagComponent”
  40. 40. Explizit und Exklusive?
  41. 41. struct MyType: Component { enum `Type` { case person, organisation } let value: Type } e += MyType(value: .person) let group = ctx.group(MyType.matcher) let people = group.filter { $0.get(MyType.self)?.value == .person }
  42. 42. Indexierung der Werte
  43. 43. struct Name: Component {let value: String} let ctx = Context() let nameIndex = ctx.index { (name: Name) -> String in name.value } let entities: Set<Entity> = nameIndex["Maxim"]
  44. 44. Ziehen vs. Drucken
  45. 45. Context, Group und Entity sind Observable
  46. 46. public protocol ContextObserver : Observer { public func created(entity: Entity, in context: Context) public func created(group: Group, withMatcher matcher: Matcher, in context: Context) public func created<T, C>(index: Index<T, C>, in context: Context) where T : Hashable, C : Component }
  47. 47. public protocol EntityObserver : Observer { public func updated(component oldComponent: Component?, with newComponent: Component, in entity: Entity) public func removed(component: Component, from entity: Entity) public func destroyed(entity: Entity) }
  48. 48. public protocol GroupObserver : Observer { public func added(entity: Entity, oldComponent: Component?, newComponent: Component?, in group: Group) public func updated(entity: Entity, oldComponent: Component?, newComponent: Component?, in group: Group) public func removed(entity: Entity, oldComponent: Component?, newComponent: Component?, in group: Group) }
  49. 49. Applikationszustand kann völlig reaktiv und transparent gemacht werden
  50. 50. Anwendungsmuster
  51. 51. resiapp.io ⌘
  52. 52. CollectionView oder TableView Basierend auf einer Group
  53. 53. protocol EntityCell { func setEntity(_ e : Entity) }
  54. 54. let message = messageGroup.sorted()[indexPath.row] let cellId = getCellId(message: message) guard let cell = tableView.dequeueReusableCell(withIdentifier: cellId) else { return UITableViewCell() } if let cell = cell as? EntityCell { cell.setEntity(e) } return cell
  55. 55. func setEntity(_ e: Entity) { message.text = e.get(TextComponent.self)?.value R_Icon.isHidden = !e.has(ShowRComponent.cid) bgImage.image = e.has(ShowRComponent.cid) ? UIImage(named: "bubble_neu") : UIImage(named: "buble2") if let cellSize = e.get(CellSizeComponent.self)?.size { adjustMessageAndBackground(…) } }
  56. 56. Service Locator “Dependency Injection für Arme”
  57. 57. struct DocumentManagerRef: UniqueComponent { let ref: DocumentManager } struct ChatViewRef: UniqueComponent { weak var ref: ChatView? } func setupAppContext() { appContext.setUniqueComponent(DocumentManagerRef(ref: DocumentManager())) } enum AppContext { static var documentManager: DocumentManager? { return appContext.uniqueComponent(DocumentManagerRef.self)?.ref } static var chatView: ChatView? { return appContext.uniqueComponent(ChatViewRef.self)?.ref } }
  58. 58. Component als Event Userinteraktion ist Zustandsveränderung
  59. 59. struct LoadingComponent : Component {} struct LoadedComponent : Component {} struct ReLoadedComponent : Component {} struct SelectedAnswerComponent : UniqueComponent { let index : Int }
  60. 60. Was ist mit Persistieren?
  61. 61. Was ist mit Multi Threading?
  62. 62. EntitasKit vs. CoreData •Leichtgewichtig •Observable •InMemory (persistieren auf eigene Hand) •Datenzentriert, kein OOP •Kein Schema (sehr gut zum improvisieren)
  63. 63. Fragen? https://github.com/mzaks/ EntitasKit
  64. 64. Vielen Dank
  65. 65. Macoun ⌘

×