|
Re: Rule-based validation causing dependency cycles. [message #644445 is a reply to message #644397] |
Sat, 11 December 2010 12:24 |
Sebastian Zarnekow Messages: 3118 Registered: July 2009 |
Senior Member |
|
|
Hi,
simply create a lightweight service that provides something like
boolean shouldExecute(Validation) and provide an implementation in the
UI by means of dependency injection that reads the data from the
preferences and an implementation for the runtime that simply returns true.
Regards,
Sebastian
--
Need professional support for Eclipse Modeling?
Go visit: http://xtext.itemis.com
Am 10.12.10 22:38, schrieb pgbackup@yahoo.com:
> Hi,
>
> I wrote some java validators for my model (about 10 of them). Now, I
> want the user to be able to select which one of these validators to run.
> So I created a preference page in the UI plugin for the DSL. I write the
> selected rules to a prefereneStore(). However, in
> My<DSL>JavaValidator.java I need to access this preferenceStore to get
> the user selections to figure out which methods in the validator shoudl
> be executed. Thus, in the plugin.xml of the grammar project, I have to
> add the UI plugin as a runtime dependency.
>
> This ends up creating a cycle depdency since the grammar depends on the
> UI, and the UI depends on the grammar. Is there a way to resolve this
> somehow (short of moving the prefereces into a new plugin of its own)?
>
> Thanks.
|
|
|
|
Powered by
FUDForum. Page generated in 0.04235 seconds