Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Inheritance, Interfaces and Composition

Inheritance, Interfaces and Composition

A talk to on Inheritance, Interfaces and Composition for students in the course of iOS programming in Gdansk's Technical University in May 11th of 2016.

Hector Zarate

May 12, 2016
Tweet

More Decks by Hector Zarate

Other Decks in Technology

Transcript

  1. > The big dinosaur from the Jurassic World movie, That

    one that chases the girl in high heels. Not the bad one. The one that is chill. , but pink!
  2. Animal, Plants, Stuff Mammals, Birds, Amphibia, Fish, Insects… Anthropomorphic, Fera,

    Jumenta… 1.Kingdom 2.Class 3.Order 4.Genera 5.Species
  3. Animal, Plants, Stuff Mammals, Birds, Amphibia, Fish, Insects… Anthropomorphic, Fera,

    Jumenta… Felis 1.Kingdom 2.Class 3.Order 4.Genera 5.Species
  4. Animal, Plants, Stuff Mammals, Birds, Amphibia, Fish, Insects… Anthropomorphic, Fera,

    Jumenta… Felis Tigris, Panther 1.Kingdom 2.Class 3.Order 4.Genera 5.Species
  5. @interface AnimalKingdom - (void)move; - (void)ingest:(id)animalOrProduct; @end @interface MammalClass :

    AnimalKingdom @property (nonatomic) Organ *heart; @property (nonatomic) Organ *lung; -(void)drinkMilk; @end @interface FeraOrder : MammalClass @property (nonatomic) Organ *teeth; @end @interface FelisGenra : FeraOrder @property (nonatomic) Organ *tail; @end @interface TigrisSpecie : FelisGenra @end
  6. Animal Quadruped Fera Tigris Tigris Inheritance is indicated by a

    solid line with an arrowhead pointing at the super class
  7. Animal, Plants, Stuff Mammal, Birds, Amphibia, Fish, Insects… Anthropomorphic, Fera,

    Jumenta… Felis Tigris, Panther 1.Kingdom 2.Class 3.Order 4.Genera 5.Species
  8. Exercise 1: Inheritance 0 25 50 75 100 April May

    June July 0 25 50 75 100 April May June July 0 25 50 75 100 April May June July
  9. Colors.json { "glueBlackColor": "000000", "glueGray25Color": "3E3E40", "glueGray55Color": "88898C", "glueGray80Color": "c6c7cc",

    "glueGray90Color": "DFE0E6", "glueWhiteColor": "ffffff", "glueGreenLightColor": "1ed760", "glueGreenColor": "1db954", "glueGreenDarkColor": "1da74d", }
  10. Colors.json { "glueBlackColor": "000000", "glueGray25Color": "3E3E40", "glueGray55Color": "88898C", "glueGray80Color": "c6c7cc",

    "glueGray90Color": "DFE0E6", "glueWhiteColor": "ffffff", "glueGreenLightColor": "1ed760", "glueGreenColor": "c53770", "glueGreenDarkColor": "1da74d", }
  11. 1. A scientist or business person 2.good sense of humor

    3.smart 4.very successful 5.good looking
  12. 1. A scientist or business person 2.good sense of humor

    3.smart 4.very successful 5.good looking
  13. Iron Man PerfectMan Batman Ellon Musk Realizing an interface is

    indicated by a dashed line with an arrowhead pointing at the interface
  14. Exercise 2: Protocols 0 25 50 75 100 April May

    June July 0 25 50 75 100 April May June July 0 25 50 75 100 April May June July
  15. Radio Running Album Show Player Browse Artist Playlist Social Conce

    Car Chart scover Genre Ads Equalizer Inbox Podcast
  16. Radio Running Album Show Player Browse Artist Playlist Social Conce

    Car Chart scover Genre Ads Equalizer Inbox Podcast
  17. Radio Running Album Show Player Browse Artist Playlist Social Conce

    Car Chart scover Genre Ads Equalizer Inbox Podcast
  18. Radio Running Album Show Player Browse Artist Playlist Social Conce

    Car Chart scover Genre Ads Equalizer Inbox Podcast
  19. Radio Running Album Show Player Browse Artist Playlist Social Conce

    Car Chart scover Genre Ads Equalizer Inbox Podcast
  20. Radio Running Album Show Player Browse Artist Playlist Social Conce

    Car Chart scover Genre Ads Equalizer Inbox Podcast
  21. Radio Running Album Show Player Browse Artist Playlist Social Conce

    Car Chart scover Genre Ads Equalizer Inbox Podcast
  22. Exercise 3: Composition 0 25 50 75 100 April May

    June July 0 25 50 75 100 April May June July 0 25 50 75 100 April May June July
  23. @interface SPTSession : NSObject @property (nonatomic, readonly) SPTProductState *productState; @property

    (nonatomic, readonly) SPTSocialManager *socialManager; @property (nonatomic, readonly) AdController *adController; @property (nonatomic, readonly) SPUser *currentUser; @property (nonatomic, readonly) SPPlaylist *inbox; @end