Tuesday, March 4, 2014

Converters in Dart

In 2001 I was writing my first open source 'ZATreeX' which is a GUI to manipulate data regardless of what data structure is underneath. a tree Data structure was expressed though an interface (DataObject if my memory is good), and operations were also expressed through an interface that received that data and processed it. The "reference implementation" was made on the io file system...

As you expect, I'm not going to talk about that old product, but rather about generic concepts. "Making operations on data" is all what IT is about. Data differs, the operations differ, but this pattern is always there. So a language that includes this concept already in its core libraries is a language that is ready for the IT needs and this is perfect for programming efficiency:

Usually when you begin a mission (or revisit an old project), you have to spend a lot of time understanding how a given problem is solved (expressed) in that particular project. Usually there are some different possible ways, so you end up "decrypting" which of the ways the programmer chose (because you expect is somehow in one of the possible ways). Then comes the naming  issue: each person gives different names to his classes/methods and you have to understand which names correspond to the concepts you expect to find in the code. Documentations are useful for that, but frameworks are even better.

With a framework, you have a ready naming "convention" that everybody understands: when you say "Session Bean", "Struts Action", "Spring Prototype Bean", everybody understands what you're talking about and you can start explaining at a higher level...

But frameworks are many, and they compete. Therefore Sun microsystems, created the JSR to specify "standard ways" for the many existing frameworks: handling XML, database persistence, server communication (servlets)... but also more deep subjects such as transactions (JTA), connectors (JTC), extensions (JMX).

This way, a newcomer can immediately start working on a project without dealing with the specifics of a framework...

The earlier a language comes with "standard" libraries, the easier it is for the community to adopt it, since there are no time losses trying the different framework solutions and learning given solutions in the context of a project.

Converters and codecs are a central part of IT as explained in the introduction, so it's a very good news that it was addressed from the very start. here is a blog talking about the technical part of the subject

Written by Florian Loitsch 
February 2014
Converting data between different representations is a common task in computer engineering. Dart is no exception and comes with dart:convert,...