blob: c433e60bb75d947b601b1c412d6927c7062266c7 [file] [log] [blame]
---
title: Using the IPdxInstanceFactory to Create IPdxInstances
---
<!--
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.
-->
You can use the `IPdxInstanceFactory` to create an `IPdxInstance` from raw data when the domain class is not available on the server.
This option can be useful when you need an instance of a domain class for plug-in code such as a function or a loader. If you have the raw data for the domain object (the class name and each field's type and data), then you can explicitly create a `IPdxInstance`. The `IPdxInstanceFactory` is very similar to the `IPdxWriter` except that after writing each field, you need to call the create method which returns the created `IPdxInstance.`