Ce diaporama a bien été signalé.
Nous utilisons votre profil LinkedIn et vos données d’activité pour vous proposer des publicités personnalisées et pertinentes. Vous pouvez changer vos préférences de publicités à tout moment.
Smalltalk in the pocket
 Building applications for the iPhone
Disclaimer


  I’m very sorry, my english sucks... badly
             But I’ll do my best
Esteban Lorenzano

On 1994 G. Rossi teach me that Smalltalk was the
future.
  But future wasn’t here, so I worked in a lot...
Where to start?
The iPhone

Why we want to use it?
Capabilities
  Think on i386
  RAM Memory growing (256M for 3GS)
  Just one thread at a...
Why Smalltalk?

Because we like it :)
Code fast and flexible
Get rid of that ugly compile cycle and memory
management issue...
Where do we stand?
 “Ad hoc” VM
 Objective-C bridge
 Some applications already in the AppleStore
   Look for “WikiServer” ...
Our goal


  To provide a framework for programming
       the iPhone in a “Smalltalk way”
Deimos - Basics (1)

 “Some kind” MVC Framework
  Model: Anything you want
  View: a NIB file
  Controller: Deimos
Deimos - Basics (2)

 Uses external files
   You need to compile the “Ad hoc” VM each time
   This is because of the NIB fil...
Deimos - Creating a view (1)
 On Objective-C side
 Yes... you need to create the NIB files outside the
 smalltalk image
   ...
Deimos - Creating a view (2)
 On Pharo side
 Extend DEView
   override #createViewDefinition and maybe
   #initializeConten...
Deimos - Access widgets
This is why the #tag property must be assigned: we
look for them recursively, as childs of an UIVi...
Deimos - Event callbacks
 Once you mapped your widget, it is very simple
Deimos - Navigate views
 [#show:|#showModal:|push:]/#answer: circuit
   Yes, very similar to Seaside, I “borrowed” that
 #...
Deimos - Internals (1)
Using contexts to handle window navigations
  So we can stack views and control behavior in a
  fas...
Deimos - Internals (2)
 Announcements for handling events
   For internal use (e.g. #onAnswer:)
   Also provided for devel...
Deimos - Internals (3)
 Using one green thread for each:
   Delegate object
   Event callback
 This can be a problem in th...
Deimos - Internals (4)
 Using WeakRegistry for disposing the not-used views
   A controversial solution (but working)
 May...
Show time!
Problems found (1)
The “dead lock problem”
  Being worked on (by John... and my self testing)
Philosophical problem: how d...
Problems found (2)
Performance
  Not really an issue, but you have to take into account
  that you are programming for the...
Future
...a Sponsor, maybe?
Stabilization and optimization
call & return full cycle support
  I don’t like the #onAnswer: ...
...far in the future
 Getting rid of NIB files, using a declarative style
   Lot of problems to solve (aquire images, for i...
Why is called “Deimos”
It is not about greek/roman mythology
Is about “being around Mars”
  “...but that’s another story, ...
Questions?
Thank you!
Esteban Lorenzano - estebanlm@smallworks.com.ar
Prochain SlideShare
Chargement dans…5
×

Smalltalk in the pocket - Building applications for the iPhone

1 650 vues

Publié le

Bring Smalltalk into new technologies is always a hard but exciting job. In this talk we take another step from those already made, and we walk one of the possible approaches to build iPhone applications using Pharo.

  • Soyez le premier à commenter

  • Soyez le premier à aimer ceci

Smalltalk in the pocket - Building applications for the iPhone

  1. 1. Smalltalk in the pocket Building applications for the iPhone
  2. 2. Disclaimer I’m very sorry, my english sucks... badly But I’ll do my best
  3. 3. Esteban Lorenzano On 1994 G. Rossi teach me that Smalltalk was the future. But future wasn’t here, so I worked in a lot of crap Until 2007, where I, with two friends founded Smallworks to work on the future promised
  4. 4. Where to start?
  5. 5. The iPhone Why we want to use it? Capabilities Think on i386 RAM Memory growing (256M for 3GS) Just one thread at a time
  6. 6. Why Smalltalk? Because we like it :) Code fast and flexible Get rid of that ugly compile cycle and memory management issues We can take benefict from the green threads of Pharo/ Squeak
  7. 7. Where do we stand? “Ad hoc” VM Objective-C bridge Some applications already in the AppleStore Look for “WikiServer” and “Fractions Calculator”, for instance So, thanks John!
  8. 8. Our goal To provide a framework for programming the iPhone in a “Smalltalk way”
  9. 9. Deimos - Basics (1) “Some kind” MVC Framework Model: Anything you want View: a NIB file Controller: Deimos
  10. 10. Deimos - Basics (2) Uses external files You need to compile the “Ad hoc” VM each time This is because of the NIB files, mainly. Uses ObjectiveC bridge
  11. 11. Deimos - Creating a view (1) On Objective-C side Yes... you need to create the NIB files outside the smalltalk image Very important: use #tag property from UI widgets #tag is there for using it, so... is not so bad (althought I don’t like it)
  12. 12. Deimos - Creating a view (2) On Pharo side Extend DEView override #createViewDefinition and maybe #initializeContents Register for execution
  13. 13. Deimos - Access widgets This is why the #tag property must be assigned: we look for them recursively, as childs of an UIView We wrap (and cache) all this UI widgets as equivallent Deimos widgets You look for them just once You can interact with them as Smalltalk objects
  14. 14. Deimos - Event callbacks Once you mapped your widget, it is very simple
  15. 15. Deimos - Navigate views [#show:|#showModal:|push:]/#answer: circuit Yes, very similar to Seaside, I “borrowed” that #push: makes a show inside a navigation controller (that “flows” the views). Works only when views are inside a navigation.
  16. 16. Deimos - Internals (1) Using contexts to handle window navigations So we can stack views and control behavior in a fashion way
  17. 17. Deimos - Internals (2) Announcements for handling events For internal use (e.g. #onAnswer:) Also provided for developers (yes, right now that means: me)
  18. 18. Deimos - Internals (3) Using one green thread for each: Delegate object Event callback This can be a problem in the future, but right now is working pretty cool
  19. 19. Deimos - Internals (4) Using WeakRegistry for disposing the not-used views A controversial solution (but working) Maybe we can use a “cached views solution” to get better performance, but it is still being studied.
  20. 20. Show time!
  21. 21. Problems found (1) The “dead lock problem” Being worked on (by John... and my self testing) Philosophical problem: how do I test this? Debugging is also a problem inside callbacks
  22. 22. Problems found (2) Performance Not really an issue, but you have to take into account that you are programming for the iPhone Image size Very tight to performace
  23. 23. Future ...a Sponsor, maybe? Stabilization and optimization call & return full cycle support I don’t like the #onAnswer: stuff... I don’t know how to do this, and even if possible, but I will try Use bundles to avoid VM recompilation. Cool be nice, but I’m not sure about this point... I like more the next point
  24. 24. ...far in the future Getting rid of NIB files, using a declarative style Lot of problems to solve (aquire images, for instance) But this will drive us back to full-smalltalk programming, so it worths the effort. Why not an iMagritte?
  25. 25. Why is called “Deimos” It is not about greek/roman mythology Is about “being around Mars” “...but that’s another story, and should be told another time” (Michael Ende, The Neverending Story)
  26. 26. Questions?
  27. 27. Thank you! Esteban Lorenzano - estebanlm@smallworks.com.ar

×