esodan

Free & Open Source Software


Leave a comment

Serialization & XML

GXml is a project providing GObject bindings to libxml2 library. It is written in Vala, making easy to access it to any programming language supporting GObject Introspection.

Recently has gained a Serialization framework. They allow to provide .NET equivalent capabilities like write a XML representation of a GObject.

.NET have lots of features and there’s no a feature comparative, GXml Serialization framework provide following features:

  • Provide a Serializable interface to provide user defined GObject to XML serialization
  • Provide two Serializable implementations, but just SerializableObjectModel have been extensively tested and more XML/.NET oriented
  • Allows to use Gee collections of Serializable objects
  • Subclassing one of GXml’s Serializable implementations allows any GObject to be serializable in XML

This features are more flexible than .NET implementation, at least last time I visited. You can customize how your object will be serialized to XML; is not difficult to implement new Serializable implementations; you can use not just arrays, but any collection supported by GXml & Gee, making easy to store your objects in arrays, hash tables and dual key hash tables, and use that collection as a Serializable object property to be serialized to XML.

There are support for simple GObject properties like strings and integers. You can define an enumeration as a property and serialization framework will translate a string representation to XML for you using GLib/GObject enums introspections.

You can take control on XML node’s name and if a property will be a node’s property or a node’s text content.

 

 

 

 

Advertisements


Leave a comment

Vala & Database Engines

GDA is a library to access to Database engines like PostgreSQL, MySQL, SQLite and others. From its early versions, uses C and GObject technologies to provide an uniform API to programmers to all its supported engines, allowing to use different connections, at the same time, to different engines using same code.

From version 4 series, GDA has support upstream for GObject Introspection and Vala programming language. That allows to use its features from different languages.

Vala is specially powerful and allows to provide both C and GObject Introspection for any library and GDA takes that advantages to provide a library called libgdadata, made using just Vala and providing lots of interfaces and its implementations to provide a simple, jet powerful GObject API to access Database data.

Libgdadata, was inspired by Django framework, to provide same capabilities to C and GObject Introspection, allowing to use its simplicity to any application, like some one using JavaScript, the official GNOME programming language.

If you would like to take a trip about libgdadata, you can access to its GNOME Live Wiki pages at https://wiki.gnome.org/Projects/GdaValaExtensions. Check out GDA source code.