1. Who Needs Your API? Flashcards

1
Q

What are the five steps to take prior to building a RESTful API?

A
  1. Decide what functionality to expose
  2. Decide how you want to expose it
  3. Decide the best ways to expose it
  4. Test and (in)validate assumptions
  5. Repeat
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the challenges to a good API design?

A

Naming things well while simultaneously describing how to interact with those things. Also, as the API sees the real world, the goals and the purpose of the API will evolve. This may require us to find better words to describe our efforts and adjust accordingly, which gets a versioning and backwards compatibility.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are affordances in the context of APIs?

A

Something that allows you to perform an action or accomplish a goal. Everything that you allow a user to do is an affordance.

eg. A door knob is an affordance that allows you to open a door.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What are the three different “what”s that are in play when it comes to affordances, and what happens if they aren’t aligned vs are aligned?

A
  1. What the API does
  2. What the API makes easy
  3. What the user wants to do
  • When these aren’t aligned, we may have a useless API, or maybe a powerful API that doesn’t do what we need.
  • When they are aligned, we have a unique combination that’s incredibly powerful but so subtle you don’t even notice.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the two approaches for adding an API to your system?

A
  1. The Bolt-On Strategy

2. The Greenfield Strategy

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the Bolt-On Strategy?

A

An approach for adding a new API to your system. It’s used when you have an existing application and add an application “after the fact”.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What are the two benefits of the bolt-on strategy?

A
  1. Brute-force approach but is generally the fastest way to get something useful since the underlying system is functional the whole time
  2. Takes advantage of the existing code and systems so you don’t have to re-think anything.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the drawback of the bolt-on strategy?

A
  1. Problems in the application and architecture tend to “leak through” into the API.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the greenfield strategy?

A

An approach for creating a new API when there’s no underlying application, or even necessarily business logic, that you have to interact with — you have complete freedom and flexibility to do whatever you want, however you want to do it.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What are the two benefits of the greenfield strategy?

A
  1. The easiest scenario to develop an API in.

2. Takes advantage of new technologies and architectures, and possible reinvigorates them

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the drawback of the greenfield strategy?

A
  1. Often requires massive upfront investment before any benefits are gained
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is the facade strategy?

A

An approach for creating a new API where you take advantage of the existing business systems, yet shape them to what you prefer and need. It’s somewhere in between the bolt-on and the greenfield strategies.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What is the benefit of the facade strategy?

A

It gives the ability to keep working systems in place while making the underlying architecture better.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What are the two drawbacks of the facade strategy?

A
  1. It can be challenging to have “multiple mindsets” in the system.
  2. It can be hard to replicate behaviour for full 1:1 conversion.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What are the three simple rules for modelling APIs?

A
  1. Don’t worry about tools. (NoteCards, Post-it Notes, Kanban, etc.)
  2. Have a consistent process.
  3. It doesn’t count unless it’s written down (document everything!)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What should you document while designing a RESTful API?

A

Your assumptions, decisions, deferred tasks, and anything else that might be important to you, your team, or your customers in six months.

17
Q

Who are the participants in the context of RESTful APIs?

A

The people and other entities who will be involved in the business process that uses the API.

18
Q

Who/what is involved in our business process?

A

Anyone who initiates an action, and anyone who waits for an action to occur.

19
Q

What do we need to know about participants?

A
  1. Who they are
  2. Whether they are internal or external to our organisation
  3. Whether they are active or passive participants
20
Q

What can be said about system boundaries in the context of RESTful APIs?

A

Be careful about them! Clearly identify what you are responsible for and what are other, even third party, components.

21
Q

What are document gaps?

A

Every specification has gaps, ambiguities, and incomplete stories. Instead of guessing, ask the product owner.