tide - a pharo/amber communication framework
DESCRIPTION
Title: Tide - A Pharo/Amber communication framework Speaker: Esteban Lorenzano Mon, August 18, 11:00am – 11:30am Video Part1: https://www.youtube.com/watch?v=pFtTCZn10Ak Video Part2: https://www.youtube.com/watch?v=LfkPay9s4wA Abstract: Tide is a new framework with the mission to make Pharo/Amber communication a breeze. It handles iteration with the server in a unified and coherent way, making easy the complexity client/server communication. Bio: Esteban Lorenzano, 42 years. Programmer since ever, Full-time Smalltalker since 2007 and Pharo enthusiast since almost its every beginning, after owning his own company and spend some years teaching at different universities in Argentina, he currently works de development of Pharo itself, at the RMoD team of INRIA (France)TRANSCRIPT
![Page 2: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/2.jpg)
A framework by…
Nicolas Petton
Esteban Lorenzano
Damien Cassou
.. while working in the Pharo team at INRIA - RMoD
![Page 4: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/4.jpg)
Yet another web framework?
![Page 5: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/5.jpg)
The problem
• Amber + REST?
• Seaside?
![Page 6: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/6.jpg)
Amber + REST
• Request nightmare
• Leads to bad design (if not super-careful)
![Page 7: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/7.jpg)
A small example
HeroView HeroModel
name: 'Groot'
Ok
![Page 8: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/8.jpg)
A small example
HeroView HeroModelHeroView HeroModel
name: 'Groot'
OkNOPE!
![Page 9: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/9.jpg)
A small exampleHeroView HeroModel
heroId: ID name: 'Groot'
Ok
HeroService
findHeroNamed: 'NotGroot'
ID, name, ...
findById: Id
hero
name: 'Groot'
Ok
HeroDAO
findByName: 'NotGroot'
hero
![Page 10: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/10.jpg)
Seaside
• It is great!
- but aging…
- and not very well prepared for “Web 2.0”
![Page 11: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/11.jpg)
We can do better
![Page 12: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/12.jpg)
The problem
• How to do MVC?
• How to expose domain without adding unnecessary layers?
• How to keep the “seaside feeling” in a fat client-server application?
![Page 13: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/13.jpg)
How?
• Amber + Pharo
• Through a communication bridge serialising JSON
![Page 14: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/14.jpg)
Client side
• Proxies
• Futures (kinda)
- Keeps the flow sequential
- It is still not synchronic, but works most of the time
![Page 15: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/15.jpg)
Server side
• Exposing objects
- <action>
- <state>
• Literals, Collections, Models
![Page 16: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/16.jpg)
Demo
![Page 17: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/17.jpg)
Counter class
HeroLair>>#heroes ^ heroes !HeroLair>>#newHero ^ Hero new !HeroLair>>#addHero:aHero heroes add: aHero !!
![Page 18: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/18.jpg)
Counter presenterHeroLair>>#heroes <state> ^ heroes !HeroLair>>#newHero <action> ^ Hero new !HeroLair>>#addHero:aHero <action> heroes add: aHero !!
![Page 19: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/19.jpg)
Counter client
lair := TDProxyClient on: ‘/lair’. lair connect. !lair heroes. “[]” lair newHero then: [ :hero | lair addHero: (hero name: ‘Groot’) ]; then: [ lair heroes collect: #name ]. “[ ‘Groot’ ]”
![Page 20: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/20.jpg)
MarinaCMS for the simple minds
![Page 21: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/21.jpg)
Yet another CMS?
![Page 22: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/22.jpg)
The problem
• Pier is HUGE
• … and hard to learn
![Page 23: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/23.jpg)
How?• Uses only already existing projects (we do not
reinvent the wheel…)
- On top of Tide (duh!)
- User management: Mozilla persona
- Syntax: Pillar (same as Pier)
- Persistency: Voyage
![Page 24: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/24.jpg)
Features• Suitable for small/simple pages
• Very simple
• Stable
• Fast
• Can accept plugins
- For now, just a basic blog (Disqus for comments)
![Page 25: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/25.jpg)
Demo
![Page 26: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/26.jpg)
![Page 27: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/27.jpg)
![Page 28: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/28.jpg)
![Page 29: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/29.jpg)
Install TidePre-requisites: node, npm, bower, pharo
$ git clone [email protected]:tide-framework/tide.git $ cd tide && bower install && cd .. $ pharo Pharo.image eval —save “ Gofer it repository: ‘filetree://tide’; package: ‘BaselineOfTide’; load. BaselineOfTide load”
TDServer startOn: 7777.
… and open your browser :)
![Page 30: Tide - A Pharo/Amber communication framework](https://reader034.vdocuments.mx/reader034/viewer/2022051412/5482dff9b4af9f7d0d8b489c/html5/thumbnails/30.jpg)
Download it today!
https://github.com/tide-framework
Thanks!!Esteban Lorenzano - 2014