essential api facade patterns - composition (episode 1)
DESCRIPTION
TRANSCRIPT
Essential API Facade PatternsEpisode 1 - Composition
Brian Mulloy@landlessness
Apigee@apigee
Santanu Dey@Santanu_Dey
groups.google.com/group/api-craft
slideshare.net/apigee
youtube.com/apigee
@Santanu_DeySantanu Dey
@landlessnessBrian Mulloy
Episode 1Composition
Episode 2Session Management
Episode 3One Phase to Two Phase Conversion
Episode 4Synchronous to Asynchronous
Webcast Series: API Facade Patterns
Episode 1 : Composition Pattern
Problem
Solution
Benefits
Considerations
Problem
Scenario: Mash-up App
Client Appon device
Service 1
Service 2
Service 3
Problem
Establish device connection to three hosts
Negotiate API/Service security each time
Normalize data format inside the app logic on the device
Multiple Service Mash-up
Client Appon device
Service 1
Service 2
Service 3
Network connection, negotiate security, data format & parsing
Network connection, negotiate security, data format & parsing
Network connection, negotiate security, data format & parsing
Solution
API Service Layer
API Service Layer
Client
Service 1
Service 2
Service 3
An Example
API Service Layer
Client
Service 1
Service 2
Service 3
1. Get Location
2. Book Cab
3. Store Booking History for
User Profile
Book a Cab App
Benefits
One-time authentication by the device.
Fewer network calls from a device.
Plug in a different service provider without having to change the app.
Validate and control before the requests reach the backend.
Request payload manipulation.
Opportunity to use Backend-as-a-Service with no additional expense to the application logic.
Generate analytics.
Other Considerations
Few other scenarios
Parallel callouts
Compensation
Chatty Services
Parallel Callouts
API Service Layer
Client
Service
Service
Book a Cab App from present location
Another Example: Chatty Services
Client
Service Provider
1. Get user attributes
2. Get recommended topics
3. Get recommended books
Solution: Reduce Chattiness
API Service Layer
Client
Service 2
1. Authenticate by API key
Get a recommended book for a user
2. Get relevant user topics
3. Get recommended books
Questions?
THANK YOUSubscribe to API webcasts at:youtube.com/apigee
THANK YOUQuestions and ideas to:groups.google.com/group/api-craft
THANK YOUContact us at:
@apigee@Santanu_Dey@landlessness