Portable Data Types (.NET & Java)
To share data among heterogeneous applications, most messaging solutions require building application based on message text which is self-descriptive. It becomes the responsibility of the application to use a format for the data so that it can be decoded by the receiving application coding. If XML data format is used, it encounters performance problems.
In addition, a highly concurrent application environment with several publishers has a greater chance of race conditions causing problems with data integrity. Messaging systems have no inherent relationship between process control messages or messages to multiple destinations messaging (queues or topics) capabilities.
Most messaging solutions are actually designed to support multiple protocols, flexibility in terms of message reliability, and more. But when it comes to opposing applications like .NET wishing to share data with Java, heavy heads or interpretation of payloads based message encoding / decoding / text message delivery settings, message correlation, research data bases related background information can be build before acting.
NCache provides with the feature of data types portability for heterogeneous applications through cache, with binary protocol which boost the performance by reducing traffic and data size with help of compact serialization. To explain this feature, let’s take example of product entity having attributes as ID, name, quantity, category etc.
The Data type portability feature will allow .NET client applications to fetch objects of product class from cache which is inserted by Java client applications and will successfully deserialize to .NET product class and vice versa. The only thing to do is to configure both product classes as shared types from administrative tools of NCache and map one or more attributes of class to other which we want to be shared across platform, non-mapped attributes will contain default value while receiving on other side.
The underlying architecture of this feature use compact serialization framework which create dynamic serialization code for product class on both side. Query Indexes are also shared among shared data types if added in query index list.
Class Attributes Mapping
|
Product Class (C#)
|
Product Class (Java)
|
ID
|
_ID
|
name
|
_name
|
price
|
_price
|
quantity
|
|
|
_category
|
In above mentioned table attributes of class has been mapped with each other, quantity and category has no mapping attribute in target class so they are left unmapped.
Query Indexes are also shared among shared data types if added in query index list.
See Also