Serialization is the process of encryption an item to your a digital structure

Review

It�s a significant aspect of coping with Coherence because the investigation should be went within the system. This new Mobile Target Structure (also known as POF) try a vocabulary agnostic binary format. POF was created to getting extremely efficient in space and you will some time was a cornerstone element in coping with Coherence. More resources for the POF digital load, look for «The newest PIF-POF Binary Style» during the Oracle additional resources Coherence Developer’s Guide .

Why must I prefer POF

There are possibilities when it comes to serialization together with important Coffee serialization, POF, plus own personalized serialization practices. For every have their particular trade-offs. Practical Coffee serialization is straightforward to apply, supports cyclic target graphs and you will conserves object term. Regrettably, it’s also comparatively slow, have a verbose binary format, and you can limited to simply Coffee stuff.

It’s very successful, during the a straightforward take to group with a series , a lengthy , and you can around three ints , (de)serialization is seven moments faster, while the digital delivered is actually you to 6th the scale compared to standard Coffee serialization.

Working with POF

POF needs that use serialization habits one to can serialize and deserialize their objects. There have been two an effective way to accomplish that:

Using the new PortableObject program

As stated a lot more than, POF elements was listed. They do this giving a numerical list for each ability that you create otherwise see regarding POF stream. It is critical to keep in mind that the latest spiders should be book to every feature written and read about POF load, specially when you have derived systems inside it since indexes need certainly to getting unique between the super group as well as the derived classification.

Applying the PofSerializer user interface:

New PofSerializer interface provide you with a way to externalize the serialization logic on the classes we want to serialize. This really is such as for example of use once you don’t want to change the framework of the classes to work well with POF and Coherence. The PofSerializer software is also made up of several steps:

Just as in the brand new PortableObject program, the aspects composed in order to otherwise realize on the POF stream need certainly to be uniquely noted. Below try an illustration implementation of brand new PofSerializer screen:

Delegating POF spiders

To purchase your checks out and writes: you should start by a minimal list really worth on your serialization program and you will finish towards the large. Whenever deserializing a regard, we want to read inside the exact same purchase you composed.

Whenever Subclassing set-aside directory ranges: index’s is collective across derived models. As such, per derived form of should be aware of your own POF list range set aside from the its very category.

Try not to re-goal your spiders: should anyone ever wanted Evolvable service, it’s vital that you usually do not lso are-goal the newest indexes of one’s functions across the category posts.

Identity your indexes: for people who identity the indexes which have a community static latest int , it will be better to work with the thing, specially when playing with PofExtractors and you may PofUpdaters. Come across Chapter twenty-five, «PofExtractors and PofUpdaters.» Note that after you have branded your own spiders, we should still make sure that he could be realize and authored call at order as stated more than.

The latest ConfigurablePofContext

Coherence will bring an effective ConfigurablePofContext classification that’s responsible for mapping an excellent POF serialized target to a suitable serialization routine (possibly a good PofSerializer or of the calling from PortableObject program). Each category is offered an alternative method of-id in POF which may be mapped to a recommended PofSerializer. Once your classes keeps serialization habits, they must be registered for the ConfigurablePofContext . Personalized member versions is actually inserted into ConfigurablePofContext using good POF arrangement document. This will be an XML file which has an excellent feature that has had a listing of kinds that implement PortableObject or provides a great PofSerializer of them. The type-id for each category have to be unique, and ought to suits all over all of the class circumstances (plus extend members).

Coherence reserves the first one thousand type-id’s having inner play with. For folks who browse directly you’ll see the member-type-record has brand new coherence-pof-config.xml file. This is where brand new Coherence certain member sizes try defined and you may is going to be used in your entire POF setting data files.

Configuring Coherence to make use of the fresh ConfigurablePofContext

In order to begin to use POF, you need to also arrange for every single services to utilize the ConfigurablePofContext . This is accomplished with the element of the cache program for the the cache setting file. This new ConfigurablePofContext takes a sequence centered you to points to your pof-arrangement document.

tangosol.pof.config= CONFIG_FILE_Street – The path toward POF configuration file we want to fool around with. Remember that should this be outside the classification road it have to be showed just like the a file money (such as document:///opt/home/coherence/mycustom-pof-config.xml ).

Summation

Using POF has some experts between performance benefits to words independence. It is recommended that you appear directly at the POF as your serialization solution when using Coherence. To own here is how to do business with POF within the .Internet, find «Setup and you can Usage to possess .Online Readers» during the Oracle Coherence Consumer Book . To have information on how to partner with POF from inside the C++, get a hold of «Configuration and Usage to have C++ Clients» into the Oracle Coherence Customer Guide .