C# (CSharp) FiftyOne.Foundation.Mobile.Detection.Factories Namespace

Classes

Name Description
CommonFactory Extension methods used to load data into the data set entity. Used at the start of both memory and stream factories. Objects of this class should not be created directly as they are part of the internal logic.
MemoryFactory Factory class used to create a DataSet from a source data structure. All the entities are held in memory and the source data structure not referenced once the data set is created.

The memory usage of the resulting data set following initialisation will be consistent. The performance of the data set will be very fast compared to the stream based implementation as all required data is loaded into memory and references between related objects set at initialisation. However overall memory usage will be higher than the stream based implementation on lightly loaded environments.

Create a fully initialised DataSet: DataSet dataSet = MemoryFactory.Create("path_to_file", true); The resulting data set can then be used to work with data or used in a FiftyOne.Foundation.Mobile.Detection.Provider to perform device detections. Use in provider like: Provider p = new Provider(dataSet);

This is a factory that creates a memory resident version of the 51Degrees device data in the form of a DataSet object.

For more information see https://51degrees.com/Support/Documentation/Net

StreamFactory Factory class used to create a DataSet from a source data structure. All the entities are held in the persistent store and only loads into memory when required. A cache mechanisim is used to improve efficiency as many entities are frequently used in a high volume environment.

The data set will be initialised very quickly as only the header information is read. Entities are then created when requested by the detection process and stored in a cache to avoid being recreated if their requested again after a short period of time.

A dataset can be created in several ways: Using a data file: DataSet dataSet = StreamFactory.Create("path_to_file", false);

Where the boolean flag indicates if the data file should or should not be deleted when close() is invoked.

Using a byte array: DataSet dataSet = StreamFactory.Create(dataFileAsByteArray);

Where the byte array is the 51Degrees device data file read into a byte array.

For more information see https://51degrees.com/Support/Documentation/Net

TrieFactory Reader used to create a provider from data structured in a decision tree format.