Ext.Direct is a framework that allows for remoting of server-side classes to the client-side as if they were local. It handles ajax requests, json encoding/decoding, and invoking the appropriate callbacks automatically. To set it up, developers download a server-side stack, configure which methods can be remotely called, and include an API descriptor on the client-side. This allows for batching of requests, centralized routing, and compatibility with both direct calls and ajax requests. Implementing a stack involves configuring exposed classes/methods, generating an API descriptor, and building a router to handle requests and responses.
5. Remoting
Expose server-side classes as if they were local to the
client-side
ContactList
• addMember
• addMemberToGroup
• getGroups
• getMembersByGroup
• removeMember
• removeMemberFromGroup
6. Lack of Boiler Plate
automatically
handled
automatically
handled
23. Server-side
• Configure methods as remotable
• Done via metadata, json, xml, or programmatic
/* @remotable */
public function getMembersByGroup($group) {
// grab members by group out of DB
}
28. Magic
When client-side stubs are invoked within a
certain threshold of time, they are batched
together and sent over an Ajax request
Direct handles invoking the appropriate
callback
33. Steps to create a Stack
1. Configure
Determine how Classes/Methods will be exposed as
remotable.
2. Generate API Descriptor
Iterate over exposed classes and methods and create
descriptor
3. Implement Router
Good afternoon everyone and thanks for joining us at SenchaCon. I'm here today to tell you about Ext.Direct and how it can help you to write your applications quicker and with less effort.
Ext.Direct allows you to seamlessly invoke server-side methods as if they were local to the browser. This lets you focus on the business aspects of your application rather than writing boiler plate Ajax code. Direct is capable of integrating with all server-side platforms and already has implementations for the most popular languages and frameworks in use today.
First we're going to take a look at the most commonly used patterns to interact with your server via Ajax and compare it to using Direct. Then I'll show you how Direct works and how you can use both of these techniques in conjunction with one another so that you can gradually transition to using Direct.
So what if a server-side stack doesn’t already exist for your language/framework?
So what if a server-side stack doesn’t already exist for your language/framework?
So what if a server-side stack doesn’t already exist for your language/framework?
First see whats required in the API Descriptor
First see whats required in the API Descriptor
First see whats required in the API Descriptor
First see whats required in the API Descriptor
First see whats required in the API Descriptor
First see whats required in the API Descriptor
First see whats required in the API Descriptor
First see whats required in the API Descriptor
So lets see how we can remote some methods and generate a descriptor like this