Mahoni
Mahoni

Reputation: 7466

Difference between binding and mapping

Is there a semantically difference in the terms

in means of binding an object model to another representation, for instance XML. Does one include only the one-way mapping or are both terms synonyms?

Use case

I have a Java object model and want to create a XML representation of it. For this I use reflection. Since I am not interested to generate Java code from the XML this is only a one-way procedure.

Upvotes: 3

Views: 4349

Answers (1)

kriss
kriss

Reputation: 24177

As far as I understand these terms binding and mapping are not exactly equivalent.

  • mapping is about transformation of a data structure into another (for instance: mapping a DTD to some object model).
  • binding is about giving access to some actual data through some kind of data structure (for instance binding some XML file to DOM).

This implies binding is one way, while mapping usually works both ways.

For the proposed use case I would use mapping, as creating the XML file should work for any data.

When speaking of binding an object model to some representation, it implies the target representation is some kind of data (a class in some programming language is an instance of the model, chosen between many possible ones). That is, you won't perform a binding of the XML structure to an (abstract) object model, but you will map it to some other implementation.

Not sure I'm clear enough, but I use binding between class and instance (I bind an instance to some existing class) and I map two data structures, or one data-set to another (two objects of the same abstraction level).

Upvotes: 4

Related Questions