Skip to Content
What is EMF

Eclipse modeling framework (EMF) is a project in Eclipse which is a modeling framework and code generation facility for building tools and other applications based on a structured data model. More details on EMF project could be found here Eclipse EMF web site

Why Querying on EMF Models

An application which is using EMF to build the model creates EMF Models and then can persist them. A typical enterprise level application generally has huge model data. These huge models then would be needed to be persisted across multiple resources. Then a gradual need will arise for searching and querying the models across the resources.

To address EMF model querying concerns EMF project has a sub project called Model Query which facilitates the search and retrieval of model elements of interest in a controlled manner. Model Query sub project again has two kinds of Query components, Model Query and Model Query2.

What is Model Query and need for Model Query2

EMF Query searches in the models by loading all the resources in the memory and then performing the search operation. So when the models grow in size, scalability of Model Query becomes a major concern. But the new Model Query2 comes with a fast and efficient index mechanism which helps to query in the resources by loading them minimally. The above mentioned index keeps track of the object type, references of the model object .It does not keep the attribute information though. The indexes can be re-used by multiple query executions. Hence the index provides incredible improvements in terms of memory consumption

Other Major features of Model Query2

While working on the model, a model resource may get modified and become dirty. So, ideally when a query or a search is performed. The result for that particular resource should also contain the information from the dirty state.Query2 provides the capability of performing queries in the dirty state as well as in the persistent state.

Expression of queries is one of the interesting parts of any query framework. Current version of Query2 allows three ways in which the queries can be expressed.

  • XText Based syntax: Query2 comes with a new easy way of expressing the syntaxes in XText based textual way.
  • LPG grammer based syntax: Another textual syntax for expressing queries which is based on LPG grammer.
  • AST format: Queries can be expressed in terms of AST which is a java object based format.

Hence an application which uses EMF models can use Model Query2 for querying the models efficiently. Furthermore frameworks and tools which are built on EMF can use Query2 in their framework for model querying, searching, refactoring etc.

To know more about Query2 please visit Bangalore Eclipse Demo camp which will be held at SAP Labs India Whitefield campus on 19th of November. I will be speaking about Query2 there. More details and info about registration can be found here.

I will keep blogging on Query2 more, about intricate details as how to query models, recent progress on Query2, APIs and other architecture details later.

To report this post you need to login first.

Be the first to leave a comment

You must be Logged on to comment or reply to a post.

Leave a Reply