Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Eclipse Projects » Sapphire » @NoDuplicates not trigger validation(@NoDuplicates )
@NoDuplicates not trigger validation [message #643998] Wed, 08 December 2010 20:07 Go to next message
Danny Ju is currently offline Danny Ju
Messages: 12
Registered: July 2009
Junior Member
I have a property list which has following spec:

public interface IModulePublishingTarget extends IModelElement,IRemovable {
ModelElementType TYPE = new ModelElementType( IModulePublishingTarget.class );
// *** Name ***
@Label( standard = "Target Name" )
@NoDuplicates
...
}

Although
@NoDuplicates
is specified, in the rendered table UI, adding duplicated
entry does not prompt error. Am I missing anything?
Re: @NoDuplicates not trigger validation [message #644199 is a reply to message #643998] Thu, 09 December 2010 16:15 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 937
Registered: July 2009
Senior Member
The @NoDuplicates annotation doesn't quite work in the way you are thinking. It is applied to the list property (not the contained value) and acts as a hint to rendering rather than a validation provider.

The behavior you are looking for is accomplished as follows:

@DependsOn( "*/Name" )
@Validator( impl = UniqueValueValidator.class )

The UniqueValueValidator class is part of Sapphire. See IContact.Connections in the samples for an example of this.

This looks like something that can be improved. I think your expectation of behavior is actually more intuitive than the current approach. Please open an enhancement request to improve the usability of the @NoDuplicates/UniqueValueValidator scenario.

- Konstantin

PS: On an unrelated topic, make sure that you do not capitalize labels in annotations or sdef files unless capitalization is required regardless of context (proper nouns, acronyms, etc.). Sapphire will automatically properly capitalize the string for the target context, but it assumes that all capital letters are significant. That is, it will only ever upercase a letter.

@Label( standard = "target name" )
Re: @NoDuplicates not trigger validation [message #644209 is a reply to message #644199] Thu, 09 December 2010 17:26 Go to previous messageGo to next message
Danny Ju is currently offline Danny Ju
Messages: 12
Registered: July 2009
Junior Member
Create a enhancement req https://bugs.eclipse.org/bugs/show_bug.cgi?id=332258
Re: @NoDuplicates not trigger validation [message #644210 is a reply to message #644209] Thu, 09 December 2010 17:39 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 937
Registered: July 2009
Senior Member
Thanks. I implemented the enhancement for the 0.2 release.

- Konstantin
Re: @NoDuplicates not trigger validation [message #645883 is a reply to message #643998] Mon, 20 December 2010 17:31 Go to previous messageGo to next message
Werner Keil is currently offline Werner Keil
Messages: 1083
Registered: July 2009
Senior Member
Are some of these annotations also going to be alligned with JSRs like
BeanValidation (already final) or JSR-308 which offers many use cases for
annotations similar to a few examples seen here.
Re: @NoDuplicates not trigger validation [message #645898 is a reply to message #645883] Mon, 20 December 2010 22:35 Go to previous messageGo to next message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 937
Registered: July 2009
Senior Member
> Are some of these annotations also going to be alligned with JSRs like
> BeanValidation (already final) or JSR-308 which offers many use cases
> for annotations similar to a few examples seen here.

Sapphire min req is Java 5, which precludes dependency on some of the newer specs, but Sapphire API design is certainly influenced by prominent specs and frameworks in use today.

If you see cases where annotation name alignment with a prominent spec would be beneficial, feel free to open bugs.

- Konstantin
Re: @NoDuplicates not trigger validation [message #646075 is a reply to message #645898] Tue, 21 December 2010 15:22 Go to previous messageGo to next message
Werner Keil is currently offline Werner Keil
Messages: 1083
Registered: July 2009
Senior Member
Do you consider advancing to those frameworks over time with new releases of
Sapphire?

I also work in projects based on Java 5 a lot, but officially Oracle/Sun has
declared that Dead 2 years ago, wasn't it...?;-)

Congrats on the EclipseCon session. Unfortunately even as mentor Chris and
the others picking those talks for 2011 either didn't fully understand the
power of some projects like UOMo, but what I suspect more is they totally
abandoned "Vertical" apps, or Domain Specific projects and solutions as you
may also tell them.

No Healthcare, no Automotive, no Embedded (except a few Mobile things) with
rather prominent examples like Sequoyah left aside completely.
On the other hand, all those technical Domain agnostic things and tools
dealing with Multithreading, etc. were selected.

And as you'll see, almost 5 competing solutions for Data Binding have some
talks:
- Sapphire
- E4
- Scout
- High Performance Tabular Databinding (they won the 1st audition)
- RedView

I hope I didn't miss any, but it is really a bit sad to see entropy in one
area (how many people will use more than one in their project ?;-) while
those really using those in the real world were completely left out.

Werner
Re: @NoDuplicates not trigger validation [message #646253 is a reply to message #646075] Wed, 22 December 2010 17:00 Go to previous message
Konstantin Komissarchik is currently offline Konstantin Komissarchik
Messages: 937
Registered: July 2009
Senior Member
> Do you consider advancing to those frameworks over time with new
> releases of Sapphire?

Probably not. Moving minreq up to Java 6 would greatly reduce the number of projects that consider Sapphire. It took a very long time for many projects to minreq Java 5. I don't see prevalence of Java 6 minreq for a very long time. In the meantime, Sapphire API needs to be stabilized and polished. Even if say 5 years down the road, a Java 6 minreq is feasible, that is unlikely to have a substantial impact on Sapphire direction.

> I suspect more is they totally abandoned "Vertical" apps, or Domain
> Specific projects and solutions as you may also tell them.

Sorry to hear that your talk was rejected. It is always an unpleasant experience. In general, conferences tend to gravitate towards framework talks over verticals due to probability of wider appeal. The other thing the program committee looks for is momentum behind a technology and frankly many of the verticals at Eclipse haven't been doing that great.

At the end of the day, I don't envy the job of the program committee. No matter what you do, you are bound to make a good number of people very unhappy.

Hope to still see you at EclipseCon.

- Konstantin
Previous Topic:show.label hint not working on vertical radio button group?
Next Topic:Custom Data Binding
Goto Forum:
  


Current Time: Mon Jul 28 04:28:45 EDT 2014

Powered by FUDForum. Page generated in 0.01774 seconds