Question:
Какая разница между OfyService и PersistenceManager?
Изучаю примеры работы с App Engine и Endpoint. В одних примерах для работы с данными (сохранение) используют PersistenceManager, а в других OfyService.
Answer:
Ответ взят от сюда:
PersistenceManager is part of the JDO (Java Data Objects) library. It is the primary interface for JDO-aware application components.
Java Data Objects (JDO) is a standard way to access persistent data in
databases, using plain old Java objects (POJO) to represent persistent
data. The approach separates data manipulation (done by accessing Java
data members in the Java domain objects) from database manipulation
(done by calling the JDO interface methods).
On the other hand ObjectifyService is part of Objectify library. It is a provider of the thread-local Objectify instances.
Objectify is a Java data access API specifically designed for the
Google Cloud Datastore.
Both libraries can be used to access Google Cloud Datastore, however, JDO is more generic and can be also used with other data stores.
As you can see here, the OfyService
is just a custom wrapper for ObjectifyService
.