+ All Categories
Home > Technology > Reef. Ajax the way it should be

Reef. Ajax the way it should be

Date post: 14-Jun-2015
Category:
Upload: esug
View: 724 times
Download: 2 times
Share this document with a friend
Description:
Reef -- Ajax the way it should be. Esteban Lorenzano, ESUG 2010, Barcelona
Popular Tags:
25
Reef Ajax the way it should be jueves 16 de septiembre de 2010
Transcript
Page 1: Reef. Ajax the way it should be

ReefAjax the way it should be

jueves 16 de septiembre de 2010

Page 2: Reef. Ajax the way it should be

Who am I?

• Esteban Lorenzano, 38

• In the community since 2007

• Started “Smallworks” with two friends, to work on Smalltalk projects (Mostly).

• Other community projects: Mars, SqueakDBX, Gofer Project Loader

jueves 16 de septiembre de 2010

Page 3: Reef. Ajax the way it should be

Seaside is cool...

For all the reasons you already know

So, why we need another tool?

jueves 16 de septiembre de 2010

Page 4: Reef. Ajax the way it should be

So, what’s Reef?

Javascript/Ajax component framework for Seaside

jueves 16 de septiembre de 2010

Page 5: Reef. Ajax the way it should be

The problem

We want to provide a transparent model, where all the diferent kinds of interactions are

handled the same way.

jueves 16 de septiembre de 2010

Page 6: Reef. Ajax the way it should be

Architecture

Dispatcher at client side handles browser-to-smalltalk interaction.

Browser

Dispatcher

Server

Page

jueves 16 de septiembre de 2010

Page 7: Reef. Ajax the way it should be

Architecture

• Uses jQuery

• First version uses both: prototype and jQuery, but that was ugly and fortunately deprecated

jueves 16 de septiembre de 2010

Page 8: Reef. Ajax the way it should be

Architecture

• “Some kind” Model-View-Controller

• but, as Seaside, Reef components has view-controller at the same place.

jueves 16 de septiembre de 2010

Page 9: Reef. Ajax the way it should be

Architecture

• You can add any component (with any complexity) as a Seaside component.

• call #asComponent

jueves 16 de septiembre de 2010

Page 10: Reef. Ajax the way it should be

Relax moment

jueves 16 de septiembre de 2010

Page 11: Reef. Ajax the way it should be

Component model

• You create your components

• by extending a REContainer (can be REPanel, REForm, etc.)

• or creating a widget structure inside a Seaside component.

• Right now, just those widgets I needed... but extensible any time.

jueves 16 de septiembre de 2010

Page 12: Reef. Ajax the way it should be

Demo

jueves 16 de septiembre de 2010

Page 13: Reef. Ajax the way it should be

Conventions

• Buttons should trigger an action, not a form submission. (#callback:)

• Forms should allow triggering (#trigger, #triggerThenDo:)

• Form widgets also

• Just panels can be refreshed (#refresh, #refreshThenDo:)

jueves 16 de septiembre de 2010

Page 14: Reef. Ajax the way it should be

Demo

jueves 16 de septiembre de 2010

Page 15: Reef. Ajax the way it should be

Using callbacks

• Simple callbacks. It fires a “dispatch” action, which is a simple “jQuery load” (but you don’t do it).

• Client callbacks. Generates a jQuery script, which is executed in the browser.

• Page callbacks. It renders a new page.

jueves 16 de septiembre de 2010

Page 16: Reef. Ajax the way it should be

Demo

jueves 16 de septiembre de 2010

Page 17: Reef. Ajax the way it should be

Context

• Some times you need to force some behavior, and you need to know if you are inside a Reef callback or a normal callback.

• REContext

• #isInContext

• #inPage:, #inClient:

• Example: REComponent>>#answer renders a new page

jueves 16 de septiembre de 2010

Page 18: Reef. Ajax the way it should be

Demo

jueves 16 de septiembre de 2010

Page 19: Reef. Ajax the way it should be

Relax moment

jueves 16 de septiembre de 2010

Page 20: Reef. Ajax the way it should be

Decorations

• Just like Seaside, your components can be decorated to add behavior

• Unlike Seaside, you can decorate widgets too. It allows elegant adding of plugins.

• Numeric format on text field

• Date format on text field

jueves 16 de septiembre de 2010

Page 21: Reef. Ajax the way it should be

Demo

jueves 16 de septiembre de 2010

Page 22: Reef. Ajax the way it should be

Plugins

• You can easily add jQuery plugins, just need to find the right insertion point

• Most of the times they can be added to existing widgets through decorations (e.g. RETextField>>#beDate)

jueves 16 de septiembre de 2010

Page 23: Reef. Ajax the way it should be

No more demos

jueves 16 de septiembre de 2010

Page 24: Reef. Ajax the way it should be

What’s next?

• Add more components

• Getting some feedback from the community

• Please, use it!

jueves 16 de septiembre de 2010


Recommended