blob: e39ab502f85449181aa489e70a1a8f7533904759 [file] [log] [blame]
---
title: Serializing Data with PDX Serialization
---
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->
PDX is a cross-language data format that can reduce the cost of
distributing and serializing your objects. PDX stores data in named
fields that you can access individually to avoid the cost of
deserializing the entire data object. When you use PDX serialization
with the C++ client API, you can implement PDX serialization for each
domain object or register a `PdxSerializer` for the entire cache.
You can also set the object preference of the cache to the `PdxInstance` type, which allows you to access fields of a PDX object without deserializing the entire object.
- **[Serialize Using the PdxSerializable Class](pdxserializable-interface.html)**
Domain classes need to inherit the `PdxSerializable` abstract class to serialize and de-serialize the object. When you write objects using PDX serialization, they are distributed to the server tier in PDX serialized form.
- **[Serialize Your Domain Objects with PdxSerializer and PdxWrapper](using-pdxserializer.html)**
For domain objects that you cannot or do not want to modify, use the `PdxSerializer` and the `PdxWrapper` classes to serialize and deserialize the object's fields.
- **[Programming Your Application to Use PdxInstances](using-pdxinstance.html)**
A `PdxInstance` is a lightweight wrapper around the raw bytes of the PDX serialized objects kept in the cache. It provides applications with run-time access to files of a PDX serialized object. <%=vars.product_name%> provides the implementation of the `PdxInstance` class.
- **[Configuring PDX to Ignore Unread Fields During Deserialization](pdx-ignore-unread-fields.html)**
Use the `setPdxIgnoreUnreadFields` API to control whether PDX ignores fields that were unread during deserialization.
- **[Using PdxInstanceFactory to Create PdxInstances](using-pdxinstancefactory.html)**
You can use the `PdxInstanceFactory` API to create a `PdxInstance` from raw data when the domain class is not available on the server.
- **[Using C++ Enum Type with PDX Serialization](using-enum-type-with-pdx.html)**
Because there is no "object" base type in C++, enums cannot be directly passed as parameters to the `writeObject` and `readObject` API.
- **[Using PDX Serialization with Delta Propagation](pdx-with-delta-propagation.html)**
To use delta propagation with PDX serialization, you must implement the `Delta` interface methods.