introduction to api design: rest and java
DESCRIPTION
An introduction to application programming interfaces.TRANSCRIPT
![Page 1: Introduction to API Design: REST and Java](https://reader035.vdocument.in/reader035/viewer/2022081413/5482a5ddb4af9f175f8b4589/html5/thumbnails/1.jpg)
(1)
Introduction to API Design:REST and Java
Philip Johnson
Collaborative Software Development Laboratory
Information and Computer Sciences
University of Hawaii
![Page 2: Introduction to API Design: REST and Java](https://reader035.vdocument.in/reader035/viewer/2022081413/5482a5ddb4af9f175f8b4589/html5/thumbnails/2.jpg)
(2)
What is an API?
Specifies a boundary between 2 systems•What you can do•What you can't do
The boundary is defined by:•Functions you can invoke•Objects passed & returned
APIs can exist:•Within a single program•Between independent programs
![Page 3: Introduction to API Design: REST and Java](https://reader035.vdocument.in/reader035/viewer/2022081413/5482a5ddb4af9f175f8b4589/html5/thumbnails/3.jpg)
(3)
Advantages of APIs
Simplifies design by creating partitions Enables change without "ripple effect" Enables multiple implementations Enables development to scale•Larger development teams•Concurrent development
![Page 4: Introduction to API Design: REST and Java](https://reader035.vdocument.in/reader035/viewer/2022081413/5482a5ddb4af9f175f8b4589/html5/thumbnails/4.jpg)
(4)
Disadvantages of APIs
Increases implementation complexity Creates boundaries that can make certain changes hard to accomplish
Can impede performance optimization
![Page 5: Introduction to API Design: REST and Java](https://reader035.vdocument.in/reader035/viewer/2022081413/5482a5ddb4af9f175f8b4589/html5/thumbnails/5.jpg)
(5)
Kinds of APIs
Within a program•Separates components.•Creates "public" and "private" areas.
Between programs•Specifies a "protocol"•How to send and receive information.
![Page 6: Introduction to API Design: REST and Java](https://reader035.vdocument.in/reader035/viewer/2022081413/5482a5ddb4af9f175f8b4589/html5/thumbnails/6.jpg)
(6)
Example in-Program API: Java Collections Framework
Interface java.util.Collection•boolean add (Object o)•void clear()•boolean equals(Object o)•boolean isEmpty()
This API is implemented by:•HashSet, LinkedList, TreeSet, etc.
![Page 7: Introduction to API Design: REST and Java](https://reader035.vdocument.in/reader035/viewer/2022081413/5482a5ddb4af9f175f8b4589/html5/thumbnails/7.jpg)
(7)
![Page 8: Introduction to API Design: REST and Java](https://reader035.vdocument.in/reader035/viewer/2022081413/5482a5ddb4af9f175f8b4589/html5/thumbnails/8.jpg)
(8)
Example between-program (REST)API: Twitter
The Twitter API is a RESTful protocol:
http://api.twitter.com/version/statuses/public_timeline.format•Operations: GET•Formats: json, xml, rss, atom•Authentication: none•Parameters: trim_user, include_entities
![Page 9: Introduction to API Design: REST and Java](https://reader035.vdocument.in/reader035/viewer/2022081413/5482a5ddb4af9f175f8b4589/html5/thumbnails/9.jpg)
(9)
![Page 10: Introduction to API Design: REST and Java](https://reader035.vdocument.in/reader035/viewer/2022081413/5482a5ddb4af9f175f8b4589/html5/thumbnails/10.jpg)
(10)
Example between-program (REST)API: WattDepot
![Page 11: Introduction to API Design: REST and Java](https://reader035.vdocument.in/reader035/viewer/2022081413/5482a5ddb4af9f175f8b4589/html5/thumbnails/11.jpg)
(11)
The Solar Decathlon iHale System
![Page 12: Introduction to API Design: REST and Java](https://reader035.vdocument.in/reader035/viewer/2022081413/5482a5ddb4af9f175f8b4589/html5/thumbnails/12.jpg)
(12)
The Solar Decathlon iHale System
Within-program between-program
![Page 13: Introduction to API Design: REST and Java](https://reader035.vdocument.in/reader035/viewer/2022081413/5482a5ddb4af9f175f8b4589/html5/thumbnails/13.jpg)
(13)
On to the demo