Building Hypermedia APIs with HTML5 and Node - Helion
ISBN: 978-14-493-2456-8
stron: 244, Format: ebook
Data wydania: 2011-11-23
Księgarnia: Helion
Cena książki: 55,24 zł (poprzednio: 64,99 zł)
Oszczędzasz: 15% (-9,75 zł)
With this concise book, you’ll learn the art of building hypermedia APIs that don’t simply run on the Web, but that actually exist in the Web. You’ll start with the general principles and technologies behind this architectural approach, and then dive hands-on into three fully-functional API examples.
Too many APIs rely on concepts rooted in desktop and local area network patterns that don’t scale well—costly solutions that are difficult to maintain over time. This book shows system architects and web developers how to design and implement human- and machine-readable web services that remain stable and flexible as they scale.
- Learn the H-Factors for representing application metadata across all media types and formats
- Understand the four basic design elements for authoring hypermedia types
- Convert a simple read-only XML-based media type into a successful API design
- Examine the challenges and advantages of designing a hypermedia type with JSON
- Use HTML5’s rich set of hypermedia controls in the API design process
- Learn the details of documenting, publishing, and registering media type designs and link-relation types
Osoby które kupowały "Building Hypermedia APIs with HTML5 and Node", wybierały także:
- Django REST framework. Kurs video. Praktyczne wprowadzenie do projektowania interfejsów REST API 99,00 zł, (29,70 zł -70%)
- ASP .NET Core. Kurs video. Rozwijanie dodatkowych funkcjonalności Web API 89,00 zł, (26,70 zł -70%)
- REST API i Symfony. Kurs video. Nowoczesne aplikacje w PHP 144,86 zł, (52,15 zł -64%)
- Spring i Spring Boot. Kurs video. Aplikacje REST API w praktyce 96,25 zł, (34,65 zł -64%)
- Platforma Xamarin. Kurs video. Poziom drugi. Zaawansowane techniki tworzenia aplikacji cross-platform 99,00 zł, (39,60 zł -60%)
Spis treści
Building Hypermedia APIs with HTML5 and Node. Creating Evolvable Hypermedia Applications eBook -- spis treści
- Building Hypermedia APIs with HTML5 and Node
- SPECIAL OFFER: Upgrade this ebook with OReilly
- Foreword
- Preface
- Hypermedia API Design
- Intended Audience
- What Is Not Covered
- Contents of This Book
- Coding Style for This Book
- Conventions Used in This Book
- Using Code Examples
- Safari Books Online
- How to Contact Us
- Acknowledgements
- 1. Understanding Hypermedia
- HTTP, MIME, and Hypermedia
- HTTP Is the Transfer Protocol
- MIME Is the Media Type Standard
- Hypermedia Is the Engine
- From links to controls
- Hypermedia types
- Programming the Web with Hypermedia APIs
- The Type-Marshaling Dilemma
- Shared schema
- URI construction
- Payload decoration
- Narrow media types
- The Hypermedia Solution
- Metadata about the data
- Metadata about the application
- Summary
- The Type-Marshaling Dilemma
- Identifying Hypermedia : H-Factors
- Link Factors
- Embedding Links (LE)
- Outbound Links (LO)
- Templated Links (LT)
- Idempotent Links (LI)
- Non-Idempotent Links (LN)
- Control Factors
- Read Controls (CR)
- Update Controls (CU)
- Method Controls (CM)
- Link Annotation Controls (CL)
- Summary
- Link Factors
- Hypermedia Design Elements
- Base Format
- XML
- JSON
- HTML
- Others
- State Transfer
- Read-only
- Predefined
- Ad-Hoc
- Domain Style
- Specific
- General
- Agnostic
- Application Flow
- None
- Intrinsic
- Applied
- Base Format
- Summary
- Whats Next?
- HTTP, MIME, and Hypermedia
- 2. XML Hypermedia
- Scenario
- Designing the Maze XML Media Type
- Identifying the State Transitions
- Selecting the Basic Design Elements
- The Maze+XML Document
- The collection element
- The item element
- The cell element
- The error element
- Sample Data
- The Server Code
- The Collection State Response
- The Item State Response
- The Cell State Response
- The Exit State Response
- The Client Code
- Maze Game Example
- HTML5 Markup
- JavaScript
- Maze Bot Example
- HTML5 Markup
- JavaScript
- Maze Game Example
- Summary
- 3. JSON Hypermedia
- Scenario
- Designing the Collection+JSON Media-Type
- Identifying the State Transitions
- Selecting the Basic Design Elements
- The Collection+JSON Document
- Objects
- The collection object
- The error object
- The template object
- Arrays
- The data array
- The items array
- The links array
- The queries array
- Objects
- The Tasks Application Semantics
- The Data Model
- The Write Template
- Predefined Queries
- Sample Data
- Task Documents
- Design Document
- The Server Code
- The Collection Response
- The Item Response
- The Query Representations
- Handling Template Writes
- The Client Code
- The Tasks SPI Example
- HTML5 markup
- JavaScript
- The Tasks Command Line Example
- The general approach
- The add-task.js application
- The Tasks SPI Example
- Summary
- 4. HTML5 Hypermedia
- Scenario
- Designing the Microblog Media Type
- Expressing Application Domain Semantics in HTML5
- Identifying the State Transitions
- State blocks
- Users
- Messages
- Queries
- Transfer blocks
- Create new user
- Update existing user
- Follow a user
- Search for users
- Add a new message
- Reply to an existing message
- Search for messages
- State blocks
- Selecting the Basic Design Elements
- The Microblog Application Profile
- Current user and state data
- ID attribute values
- Class attribute values
- Name attributes values
- Rel attribute values
- Sample Data
- User Documents
- Message Documents
- Follow Documents
- Design Document
- The Server Code
- Authenticating Users
- Registering a New User
- Message Responses
- User Responses
- The Client Code
- The POSH Example
- The Ajax QuoteBot Example
- The QuoteBot scenario
- QuoteBot HTML5
- QuoteBot JavaScript
- Setup code
- Making requests
- Processing responses
- Support routines
- Summary
- 5. Documenting Hypermedia
- Requirements, Compliance, and RFC 2119
- The RFC 2119 Keywords
- Sample Documentation Using RFC 2119 Keywords
- Defining Compliance
- Documenting Media Type Designs
- General Layout
- Front matter
- Format
- Examples
- Tutorials
- Documenting XML Designs
- Documenting JSON Designs
- Documenting HTML Designs
- Documenting Application Domain Specifics
- Data elements
- Domain-specific data elements
- Domain-generic data elements
- Hypermedia affordances
- Domain-specific hypermedia controls
- Domain-generic hypermedia controls
- Data elements
- Publishing Media Type Designs
- General Layout
- Extending and Versioning Media Types
- Extending
- Forward compatibility
- Backward compatibility
- Rules for extending media types
- Existing design elements cannot be removed
- The meaning or processing of existing elements cannot be changed
- New design elements must be treated as optional
- Versioning
- Deciding when to version a media type
- Rules for versioning a media type
- It should be easy to identify new versions of a media type
- Implementations should reject unsupported versions
- Extending
- Registering Media Types and Link Relations
- Media Types
- Vendor/Personal tree media type registrations
- Standard tree media type registrations
- Link Relation Types
- Registering link relations with the Microformats community
- Registering link relations with the IANA
- Media Types
- Design and Implementation Tips
- Joshua Blochs Characteristics of a Good API
- Roy Fieldings Hypertext API Guidelines
- Jon Postels Robustness Principle
- Other Considerations
- Getting it right but not complete
- Maintain media type design and schema separately
- Authentication is not part of the hypermedia design
- Testing media type designs
- Requirements, Compliance, and RFC 2119
- A. Afterword
- B. References
- Chapter 1
- Chapter 2
- Chapter 3
- Chapter 4
- Chapter 5
- C. Additional Reading
- Books
- Other
- D. Maze+XML Media Type
- Elements
- cell
- code
- collection
- debug
- error
- item
- link
- maze
- message
- title
- Attributes
- debug
- href
- rel
- side
- total
- version
- Link Relations
- collection
- current
- east
- exit
- maze
- north
- south
- start
- west
- Data Types
- CDATA
- NUMBER
- TEXT
- URI
- Extensibility
- Elements
- E. Collection+JSON Media Type
- General Concepts
- Reading and Writing Data
- Reading collections
- Adding an item
- Reading an item
- Updating an item
- Deleting an item
- Query Templates
- Reading and Writing Data
- Objects
- collection
- error
- template
- Arrays
- data
- items
- links
- queries
- Properties
- code
- href
- message
- name
- prompt
- rel
- render
- title
- value
- version
- Link Relations
- collection
- items
- template
- queries
- Other Link Relation Values
- Data Types
- ARRAY
- NUMBER
- OBJECT
- STRING
- URI
- VALUE
- Extensibility
- General Concepts
- F. Microblogging HTML Semantic Profile
- General Concepts
- Compliance
- Design Characteristics
- Additional Constraints
- Semantic Profile
- Class Attribute Values
- ID Attribute Values
- Name Attribute Values
- Rel Attribute Values
- General Concepts
- G. IANA Media Type Registration Document
- H. IETF Link Relations Internet Draft
- I. Source Code, Software, and Installation Notes
- Source Code
- Prerequisites
- CouchDB
- Node.js
- Cloud Services
- Authoring
- About the Author
- SPECIAL OFFER: Upgrade this ebook with OReilly