Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » OCL » OCLHelper questions
OCLHelper questions [message #69202] Wed, 25 March 2009 12:15 Go to next message
Eclipse UserFriend
Originally posted by: zzhangh.cn.ibm.com

Hi,
Having used OCL for serveral months, however, I am still not clear on OCLHelper.
Is it a must when I use eclipse OCL? and what is the difference between below codes:

1. ocl.createQuery() and helper.createQuery()
2. ocl.evaluate() and query.evaluate()

Regards,
Hao
Re: OCLHelper questions [message #69243 is a reply to message #69202] Wed, 25 March 2009 21:33 Go to previous message
Eclipse UserFriend
Originally posted by: give.a.damus.gmail.com

--=-Z0uhUYABdNxaXHjWDCYN
Content-Type: text/plain
Content-Transfer-Encoding: 7bit

Hi, Hao,

The OCLHelper::createQuery operation parses OCL text as a query
expression. This is completely different from OCL::createQuery, which
encapsulates an already-parsed query expression or constraint in a
reusable Query object.

OCL::evaluate() is a one-shot evaluation, creating a new evaluation
environment each time. Query::evaluate reuses an evaluation environment
and is, therefore, supposed to be more efficient when repeatedly
evaluating a query.

You don't have to use OCLHelpers. They are most convenient for parsing
OCL constraints and expressions that are embedded in models, where the
text has only an expression and the rest of the context (whether it's an
invariant or a pre-condition, what is the contextual classifier, etc.)
is implied by the placement in the model.

If you generally work with *.ocl documents or the concrete syntax of
constraint context, then the helper won't be of much use.

HTH,

Christian

On Wed, 2009-03-25 at 20:15 +0800, Hao Zhang wrote:

> Hi,
> Having used OCL for serveral months, however, I am still not clear on OCLHelper.
> Is it a must when I use eclipse OCL? and what is the difference between below codes:
>
> 1. ocl.createQuery() and helper.createQuery()
> 2. ocl.evaluate() and query.evaluate()
>
> Regards,
> Hao

--=-Z0uhUYABdNxaXHjWDCYN
Content-Type: text/html; charset="utf-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 TRANSITIONAL//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV="Content-Type" CONTENT="text/html; CHARSET=UTF-8">
<META NAME="GENERATOR" CONTENT="GtkHTML/3.24.1.1">
</HEAD>
<BODY>
Hi, Hao,<BR>
<BR>
The OCLHelper::createQuery operation parses OCL text as a query expression.&nbsp; This is completely different from OCL::createQuery, which encapsulates an already-parsed query expression or constraint in a reusable Query object.<BR>
<BR>
OCL::evaluate() is a one-shot evaluation, creating a new evaluation environment each time.&nbsp; Query::evaluate reuses an evaluation environment and is, therefore, supposed to be more efficient when repeatedly evaluating a query.<BR>
<BR>
You don't have to use OCLHelpers.&nbsp; They are most convenient for parsing OCL constraints and expressions that are embedded in models, where the text has only an expression and the rest of the context (whether it's an invariant or a pre-condition, what is the contextual classifier, etc.) is implied by the placement in the model.<BR>
<BR>
If you generally work with *.ocl documents or the concrete syntax of constraint context, then the helper won't be of much use.<BR>
<BR>
HTH,<BR>
<BR>
Christian<BR>
<BR>
On Wed, 2009-03-25 at 20:15 +0800, Hao Zhang wrote:
<BLOCKQUOTE TYPE=CITE>
<PRE>
Hi,
Having used OCL for serveral months, however, I am still not clear on OCLHelper.
Is it a must when I use eclipse OCL? and what is the difference between below codes:

1. ocl.createQuery() and helper.createQuery()
2. ocl.evaluate() and query.evaluate()

Regards,
Hao
</PRE>
</BLOCKQUOTE>
</BODY>
</HTML>

--=-Z0uhUYABdNxaXHjWDCYN--
Previous Topic:Problem while serializing the OCL AST
Next Topic:Ocl Query to retrieve all classes implementing a certain interface
Goto Forum:
  


Current Time: Thu Dec 25 12:15:25 GMT 2014

Powered by FUDForum. Page generated in 0.01541 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software