So I am working on creating a Google App Engine Application, and I've come across the term "expose" a number of times, e.g. "your first app can expose objects using an HTTP based API" and "expose this datamodel class through a REST API". What does "expose" mean? Is there a particular action associated it, or is it an abstract part of design?
4 Answers
It means that you enable objects to be accessed through some means. In your examples, you could let the users create, read, update or delete objects (usually abbreviated to CRUD) using the HTTP protocol through some predefined way to interact with your objects (an API).
That API can adhere to a set of rules - e.g. RESTful APIs use HTTP verbs to perform some actions on objects and they adhere to some principles that say how resources should be identified/represented and how they should be manipulated through those representations.
In the context of a web application, let's say you have blog posts stored in your database. You would like the users of your application to be able to do something with those posts. They don't have to necessarily use your web site, but could perhaps use their own application that would connect to your application (e.g. a blog reader program).
As the owner of your application, you could define an interface through which your application can be accessed. For example, you might want to add an option for some users to read or write blog posts. The interface could look something like this (for an example of a more complex API, see Twitter's API definition):
- If a
GET /posts/{number} HTTP/1.1
is requested from your web application, you will provide a representation of your post object with an id{number}
in a predefined format
Note that you are not providing an actual database object, nor your application object. You are providing a representation of your object
- If a
POST /posts HTTP/1.1
with atitle={text1}&body={text2}
is posted to your web application, you will create a new post object titled{text1}
that will contain{text2}
for its body, and will return an id value of the newly created post
Again, you are allowing the user the manipulate representations of your objects. The user does not have to know how your objects actually look like (that is abstracted away by the interface from the user).
Exposing the object means providing the user with an interface to access and manipulate your objects. If that interface satisfied some additional predefined conditions regarding representations of the object and states of the application that exposes its objects, then that interface is said to be a REST (or RESTful) API.
"Expose" here means what it means in regular English - give access where access would not otherwise be available.
For instance "your first app can expose objects using an HTTP based API" means that someone on another machine can manipulate your object on your machine by asking for the right web pages.
Unfortunately, that's not what "expose" means in regular English. A typical definition of "expose" is "to remove what is covering something so that it can be seen." That has nothing to do with "give access."
This is the whole point: in the API world, "expose" has been turned into a jargon word that means something different from its "regular" English meaning.
-
I found reading the dictionary definition of "expose" just now, very good for a laugh - it almost invariably suggests something improper is occurring or that something is subject to an unnatural condition.– SteveCommented Oct 12, 2022 at 20:31
-
I don't see any incompatibility between the usual English meaning of "expose" and the software jargon. If something is hidden, nobody else can access it. If it's exposed, then they can.– Simon BCommented Oct 13, 2022 at 9:19
"Jargon": special words or expressions that are used by a particular profession or group and are difficult for others to understand.
-
As it’s currently written, your answer is unclear. Please edit to add additional details that will help others understand how this addresses the question asked. You can find more information on how to write good answers in the help center.– Community BotCommented Oct 12, 2022 at 21:13
-
Please edit this into your other answer instead of posting a new answer.– CPlusCommented Oct 12, 2022 at 21:14