SlideShare a Scribd company logo
1 of 189
Finally living objects  in your Rails UI
cells with interactive behaviour and  statefulness
communicating through events
The name?
Apotomo
 
after this talk...
...i want you to be scared of Apotomo
What is Apotomo? ,[object Object],[object Object],[object Object]
it's all about...
[object Object]
[object Object],[object Object],[object Object]
Any benefits? from this “stateful widget” thing?
“ stateful ” ,[object Object],[object Object]
“ widget “ ,[object Object],[object Object]
“ widget “ ,[object Object],[object Object]
“ widget “ ,[object Object],[object Object]
“ widget “ ,[object Object],[object Object]
“ widget “ ,[object Object],[object Object]
Who's me? ,[object Object],[object Object],[object Object],[object Object]
I'm currently working on... wickedornot.com
wickedornot.com
a mixture of blog/game/community
wickedornot.com
you upload products and you can rate other users
wickedornot.com
you can comment stuff
wickedornot.com
you can upload pictures for that product
wickedornot.com
“interesting.”
[object Object],[object Object],[object Object],[object Object],[object Object]
let's look at the gallery
 
[object Object]
[object Object]
[object Object]
how do we implement that?
Start : the WidgetTree ,[object Object],[object Object],[object Object],[object Object]
I start by adding a container widget
 
 
 
I keep adding fine-graind child widgets to the container
 
 
 
 
each widget has some corresponding view in the app
#cell ,[object Object],[object Object],[object Object],[object Object],[object Object]
What we just got ,[object Object],[object Object],[object Object]
wow, we just covered...
My widgets should be... ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
meaning... ,[object Object],[object Object]
How do we plug in these widgets into the actual application?
#act_as_widget ,[object Object]
meaning we're referencing to the gallery container
#act_as_widget
#act_as_widget
[object Object]
and process its events
what we get is a nice, interactive gallery!
 
another composing examble would be the tabs!
a nice tab panel, within rails!
it's all about adding tabs to the panel
 
 
and adding actual content widets to the tabs
 
Tab  and  TabPanel  are out-of-the-box widgets and are shipped with Apotomo (just for your convenience)
next:  statefulness ?
example: the upload thing
it's a commonly used upload form
 
it is already added somewhere in the WidgetTree
somewhere in the WidgetTree... ,[object Object],[object Object]
a widget goes to its  start state   when it's rendered the first time
now we're going to  look  at the actual, concrete source of the upload widget
app/cells/product_image_cell.rb ,[object Object],[object Object],[object Object]
the  new.html.erb  looks like...
app/cells/product_image/new.html.erb ,[object Object],[object Object]
[object Object],[object Object]
in other words...
...when submitting the form we are  sending  the upload widget to  another state
:new :create
let's look at the next state
once again, the widget code
the state  :create ,[object Object],[object Object],[object Object],[object Object],[object Object]
either ways, the widget will automatically update its view on the screen
where did that  @image  come from?
[object Object],[object Object]
the state is preserved! @image @image :new :create
So, this is  stateful ,[object Object]
So, this is  stateful ,[object Object]
My widgets should be... ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
so, this was an upload, but...
how do the fellow widgets know, there is a new image uploaded?
?
why not use an event?
when the upload was ok...
...we  trigger  an event
[object Object]
[object Object]
The answer: use an  EventHandler !
adding EventHandlers I ,[object Object],[object Object]
adding EventHandlers II ,[object Object],[object Object]
let's have a  quick  look at the  triggering  process
the  newImage  event is triggered
it bubbles up ,[object Object],[object Object]
?
?
[object Object],?
and it  fires  the EventHandler  we just attached with  #watch
the fired  EventHandler  will advise  the thumbnails widget  to  update  itself
a new thumbnail appears
 
and the newly uploaded picture appears in full-screen
 
Great - although the  upload  widget  didn't even know there  is  a thumbnail gallery...
it just updated  a bunch  of other widgets
My widgets should be... ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
and now?  reusability ?
reusability – sharing behaviour ,[object Object]
reusability – sharing behaviour ,[object Object]
reusability – sharing behaviour ,[object Object]
for example
 
 
this is a widget for rating  a product
we could  reuse  that widget in an iPhone mobile version, too!
[object Object],[object Object],[object Object]
 
a mobile controller
again, we're referencing a widget  in the widget tree in  #act_as_widget
 
 
[object Object],[object Object]
have a look at the mobile controller
 
My widgets should be... ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Finally, some neat stuff!
Apotomo  wraps  YUI widgets
example: the  DataTable  in  YUI
example: the  DataTable  in  YUI ,[object Object],[object Object],[object Object]
just to show off how  awesome  Apotomo is...
I'm gonna embed the  DataTable   in my wickedornot.com app
by adding a new Tab
embedding the DataTable
 
 
 
let's have a brief look at this cool  MyDataTable  widget
app/cells/my_data_table_cell.rb
all we gotta do...
inheriting from  YUI::DataTable
adding columns
fill the data store with ...data
[object Object]
paging?
works all out-of-the-box
My widgets should be... ,[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Come on, one more!
what about adding some observing widget?
watching for clicks in the  DataTable ?
this could look like...
add an observing widget
the implementation in the WidgetTree would be...
 
 
 
again, the  #watch  just means
“watch out for a  cellClick  event!”
“if you see one, update the observer!”
CLICK!
 
to summarize that
[object Object],[object Object]
I clicked a cell in the grid
this triggered an event, actually in  Apotomo
[object Object],in  Ruby
Enough!
There is more!
Caching
Caching
Testing ,[object Object],[object Object]
[object Object],[object Object],[object Object],[object Object],[object Object],[object Object]
Enough for today...
Enough for today... are you scared of Apotomo?

More Related Content

Similar to Apotomo Goes Rubyconf

The battle between the states (all about flutter stateless & stateful widgets...
The battle between the states (all about flutter stateless & stateful widgets...The battle between the states (all about flutter stateless & stateful widgets...
The battle between the states (all about flutter stateless & stateful widgets...Katy Slemon
 
How to create ui using droid draw
How to create ui using droid drawHow to create ui using droid draw
How to create ui using droid drawinfo_zybotech
 
JetBot basic motion
JetBot basic motionJetBot basic motion
JetBot basic motionPeiJia5
 
How tomakea gameinunity3d
How tomakea gameinunity3dHow tomakea gameinunity3d
How tomakea gameinunity3dDao Tung
 
IOS Swift language 1st Tutorial
IOS Swift language 1st TutorialIOS Swift language 1st Tutorial
IOS Swift language 1st TutorialHassan A-j
 
Bowtie: Interactive Dashboards
Bowtie: Interactive DashboardsBowtie: Interactive Dashboards
Bowtie: Interactive DashboardsJacques Kvam
 
SwiftUI - Performance and Memory Management
SwiftUI - Performance and Memory ManagementSwiftUI - Performance and Memory Management
SwiftUI - Performance and Memory ManagementWannitaTolaema
 
Inside Flutter: Widgets, Elements, and RenderObjects
Inside Flutter: Widgets, Elements, and RenderObjectsInside Flutter: Widgets, Elements, and RenderObjects
Inside Flutter: Widgets, Elements, and RenderObjectsHansol Lee
 
Ios actions and outlets
Ios actions and outletsIos actions and outlets
Ios actions and outletsveeracynixit
 
Ios actions and outlets
Ios actions and outletsIos actions and outlets
Ios actions and outletsveeracynixit
 
Modular View Controller Hierarchies
Modular View Controller HierarchiesModular View Controller Hierarchies
Modular View Controller HierarchiesRené Cacheaux
 
Different types of sticker apps
Different types of sticker appsDifferent types of sticker apps
Different types of sticker appsJelena Krmar
 
28-GUI application.pptx.pdf
28-GUI application.pptx.pdf28-GUI application.pptx.pdf
28-GUI application.pptx.pdfNguynThiThanhTho
 
Alfresco - You probably didn't know that
Alfresco - You probably didn't know thatAlfresco - You probably didn't know that
Alfresco - You probably didn't know thatDavid Ciamberlano
 
Mobile App Feature Configuration and A/B Experiments
Mobile App Feature Configuration and A/B ExperimentsMobile App Feature Configuration and A/B Experiments
Mobile App Feature Configuration and A/B Experimentslacyrhoades
 

Similar to Apotomo Goes Rubyconf (20)

The battle between the states (all about flutter stateless & stateful widgets...
The battle between the states (all about flutter stateless & stateful widgets...The battle between the states (all about flutter stateless & stateful widgets...
The battle between the states (all about flutter stateless & stateful widgets...
 
How to create ui using droid draw
How to create ui using droid drawHow to create ui using droid draw
How to create ui using droid draw
 
iOS Development (Part 2)
iOS Development (Part 2)iOS Development (Part 2)
iOS Development (Part 2)
 
JetBot basic motion
JetBot basic motionJetBot basic motion
JetBot basic motion
 
IOS Storyboards
IOS StoryboardsIOS Storyboards
IOS Storyboards
 
How tomakea gameinunity3d
How tomakea gameinunity3dHow tomakea gameinunity3d
How tomakea gameinunity3d
 
IOS Swift language 1st Tutorial
IOS Swift language 1st TutorialIOS Swift language 1st Tutorial
IOS Swift language 1st Tutorial
 
Bowtie: Interactive Dashboards
Bowtie: Interactive DashboardsBowtie: Interactive Dashboards
Bowtie: Interactive Dashboards
 
V2vdata
V2vdataV2vdata
V2vdata
 
Java beans
Java beansJava beans
Java beans
 
SwiftUI - Performance and Memory Management
SwiftUI - Performance and Memory ManagementSwiftUI - Performance and Memory Management
SwiftUI - Performance and Memory Management
 
Inside Flutter: Widgets, Elements, and RenderObjects
Inside Flutter: Widgets, Elements, and RenderObjectsInside Flutter: Widgets, Elements, and RenderObjects
Inside Flutter: Widgets, Elements, and RenderObjects
 
Ios actions and outlets
Ios actions and outletsIos actions and outlets
Ios actions and outlets
 
Ios actions and outlets
Ios actions and outletsIos actions and outlets
Ios actions and outlets
 
Modular View Controller Hierarchies
Modular View Controller HierarchiesModular View Controller Hierarchies
Modular View Controller Hierarchies
 
I phone versus windows phone 7 coding
I phone versus windows phone 7 codingI phone versus windows phone 7 coding
I phone versus windows phone 7 coding
 
Different types of sticker apps
Different types of sticker appsDifferent types of sticker apps
Different types of sticker apps
 
28-GUI application.pptx.pdf
28-GUI application.pptx.pdf28-GUI application.pptx.pdf
28-GUI application.pptx.pdf
 
Alfresco - You probably didn't know that
Alfresco - You probably didn't know thatAlfresco - You probably didn't know that
Alfresco - You probably didn't know that
 
Mobile App Feature Configuration and A/B Experiments
Mobile App Feature Configuration and A/B ExperimentsMobile App Feature Configuration and A/B Experiments
Mobile App Feature Configuration and A/B Experiments
 

Recently uploaded

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostZilliz
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsRizwan Syed
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embeddingZilliz
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLScyllaDB
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr BaganFwdays
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfRankYa
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesZilliz
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupFlorian Wilhelm
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Recently uploaded (20)

Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage CostLeverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
Leverage Zilliz Serverless - Up to 50X Saving for Your Vector Storage Cost
 
Scanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL CertsScanning the Internet for External Cloud Exposures via SSL Certs
Scanning the Internet for External Cloud Exposures via SSL Certs
 
Training state-of-the-art general text embedding
Training state-of-the-art general text embeddingTraining state-of-the-art general text embedding
Training state-of-the-art general text embedding
 
Developer Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQLDeveloper Data Modeling Mistakes: From Postgres to NoSQL
Developer Data Modeling Mistakes: From Postgres to NoSQL
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan"ML in Production",Oleksandr Bagan
"ML in Production",Oleksandr Bagan
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Search Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdfSearch Engine Optimization SEO PDF for 2024.pdf
Search Engine Optimization SEO PDF for 2024.pdf
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Vector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector DatabasesVector Databases 101 - An introduction to the world of Vector Databases
Vector Databases 101 - An introduction to the world of Vector Databases
 
Streamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project SetupStreamlining Python Development: A Guide to a Modern Project Setup
Streamlining Python Development: A Guide to a Modern Project Setup
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

Apotomo Goes Rubyconf