|
|
|
Re: Xcore Validation [message #892010 is a reply to message #891944] |
Tue, 26 June 2012 15:52   |
Eclipse User |
|
|
|
Miles,
Comments below.
On 26/06/2012 6:06 PM, Miles Parker wrote:
> Ed,
>
> Can you say a bit more about invariant operations? Do you mean just
> like with the current validation framework?
Yes; it's just an EOperation with a special signature, so you can define
an XOperation that will convert to the right thing and have an Xbase body...
> It seems like that might still be more maintainable, as at least the
> logic and annotations would be in one place. Do you happen to have an
> example of that?
No, but the validation overview shows one...
>
> On the other hand, speaking of annotations, that's the one area of
> Xcore that I'm finding disappointing. (Otherwise, it is clearly more
> productive and I think a better sale to non-modelistas.) We get these
> lovely compact text models and then they get junked up with all of the
> java style "@" verbosity for genmodel constructs, etc.. Plus you lose
> the separation of concerns. Have you thought about other ways to
> support some kind of "advisement" of the core model design that allows
> the annotations to be maintained separately?
Well, there's really no reason an external GenModel can't refer to the
EPackage that's in an Xcore resource. There's just no nice wizard to
set it up that way.
>
> cheers,
>
> Miles
|
|
|
|
Re: Xcore Validation [message #892855 is a reply to message #892850] |
Sat, 30 June 2012 10:43   |
Eclipse User |
|
|
|
<html>
<head>
<meta content="text/html; charset=UTF-8" http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
João,<br>
<br>
Comments below.<br>
<br>
<div class="moz-cite-prefix">On 30/06/2012 3:15 PM, João Paulo
Almeida wrote:<br>
</div>
<blockquote cite="mid:jsmu5u$qc4$1@xxxxxxxxe.org" type="cite">Ed,
<br>
<br>
What would be the signature of an invariant operation in XCore?
<br>
</blockquote>
<blockquote><small>import org.eclipse.emf.ecore.EDiagnosticChain<br>
import org.eclipse.emf.ecore.EMap<br>
<br>
class Foo<br>
{<br>
op boolean bar(EDiagnosticChain diagnostics, EMap<Object,
Object> context)<br>
{<br>
return true<br>
}<br>
}<br>
</small></blockquote>
<blockquote cite="mid:jsmu5u$qc4$1@xxxxxxxxe.org" type="cite">
<br>
Would it be transformed into a public boolean
validate(DiagnosticChain diagnostic, Map<Object, Object>
context)?
<br>
</blockquote>
It will be called from the generated validator:<br>
<blockquote><small> public boolean validateFoo_bar(Foo foo,
DiagnosticChain diagnostics, Map<Object, Object> context)<br>
{<br>
return foo.bar(diagnostics, context);<br>
}<br>
</small></blockquote>
<blockquote cite="mid:jsmu5u$qc4$1@xxxxxxxxe.org" type="cite">
<br>
thanks,
<br>
João Paulo
<br>
</blockquote>
<br>
<br>
</body>
</html>
|
|
|
|
Re: Xcore Validation [message #893647 is a reply to message #893641] |
Thu, 05 July 2012 02:28  |
Eclipse User |
|
|
|
Miles,
Posting it will probably just do it again:
import org.eclipse.emf.ecore.EDiagnosticChain
import org.eclipse.emf.ecore.EMap
class Foo
{
op boolean bar(EDiagnosticChain diagnostics, EMap<Object, Object>
context)
{
return true
}
}
On 05/07/2012 6:22 AM, Miles Parker wrote:
> Ed Merks wrote on Tue, 26 June 2012 15:52
>> Miles,
>>
>> Comments below.
>> On 26/06/2012 6:06 PM, Miles Parker wrote:
>> > It seems like that might still be more maintainable, as at least
>> the > logic and annotations would be in one place. Do you happen to
>> have an > example of that?
>> No, but the validation overview shows one...
>
>
> Do you mean in POEcore? I guess all the plumbing would be the same.
> Hoping for some kind of syntactic magic there. :)
>
> BTW, the code you pasted got all html'ized on the forum post. Could
> you paste it in again in human readable form?
|
|
|
Powered by
FUDForum. Page generated in 0.06013 seconds