Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] JMS Serializer Bundle Integration #28

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open

Conversation

beberlei
Copy link
Collaborator

The serialization performance of larger graphs with the form component is very slow. This is due to the form creating and binding of data. Compared to that JMS Serializer bundle is very fast.

We should aim at using JMS Serializer for serialization, based on Form Type Metadata. The same form type metadata is used for deserialization.

How it works:

You create a form type, then hint for a class which type it is:

/**
 * @FormType("SimpleThings\FormSerializerBundle\Tests\Serializer\Fixture\AddressType")
 */
class Address
{
}

This is a WIP, what needs to be done:

  1. Normalization of data with forms is much more powerful than with JMS Serializer. Both are not compatible.
  2. Property Paths in forms cannot be replicated in JMS.
  3. There can potentially be many form types for one entity. This cannot be replicated with groups in JMS Serializer. We need the form serializer to build an "on demand" metadata factory for a given graph, but cachable.
  4. Form "entity" type is not replicable in JMS Serializer with both multiple = true and false


$property = $class->getProperty($children->getName());
$propertyMetadata = new PropertyMetadata($name, $property->getName());
#$propertyMetadata->setAccessor('public_method', null, null);
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what is this ?

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

the form component uses getter/setters to access properties, jms serializer uses reflection by default. The line was an attempt to synchronize behavior, however jms serailizer doesnt detect public properties and therefore fails when using "public_method" with my test objects.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants