I have recently posted about the ability to use Bean Validation with various presentation technologies (here and there). Now Flex is part of the family. The good guys at GraniteDS have added support for Bean Validation into their project and hence Bean Validation is usable by all Flex users.

The work was not as straightforward as for JSF, Wicket or other Java technologies. Because they do not run on the JVM, they basically have reimplemented the full specification in Flex:

  • you can annotate your ActionScript3 objects with constraints: it supports all the standard constraints and you can write your own constraints
  • you can execute the validation logic and retrieve the error report
  • you can make use of most of the feature including advanced ones like groups, group sequence etc

And just like we did with JSF 2 and Bean Validation, the Flex forms do transparently call the constraints based on your domain model. What's also interesting for GraniteDS users keeping their Java domain model and ActionScript3 domain model in sync via Gas3, the constraints are kept in sync.

There are a couple of gotchas to be aware of. The port is not a one-to-one copy: some interfaces or design choice did not make sense due to how ActionScript3 works but overall this is a very close port

  • the constraint implementation is in the same class as the constraint declaration (not a problem in a dynamic language)
  • @Pattern has a sightly different semantic because the regexp engine in Flex is a bit different.
  • instead of the features provided by ConstraintValidatorContext, you can define a properties attribute in your constraints to make it belong to several sub-properties. not as flexible but good enough in many cases.
  • and maybe a few other things

Anyways, I won't talk to Franck until he has a 100% compliant implementation of the spec ;) Actually, I've got one real RFE: the documentation for this new validation module is part of the 'Advanced AS3 Features' chapter. I think this feature is simple enough and useful enough to warrant a better place.

To get the full documentation, check it out here. This is all part of the upcoming 2.2 version of GraniteDS.

PS: GraniteDS 2.2 also provides a full implementation of arbitrary-precision numbers, something that is surprisingly lacking from the Flex platform. So if you use Flex and are in banks or any other number crunching industry, check out their BigInteger and BigDecimal implementation.

24. Jun 2014, 11:56 CET | Link

However, Forex quotes are not stated as a single price. In any Forex quotes , two sets of prices are given, representing the price at which the broker or dealer will buy a currency from a trader who wants to sell, and the price at which dealer or broker will sell to a forex trader who wants to buy However, even though the market is considered a 24-hour market, its important to know when the forex market hours is actually active and when is the best time to place a trade on the market.

29. Aug 2014, 06:10 CET | Link
obat herbal kanker prostat

Click HELP for text formatting instructions. Then edit this text and check the preview. obat herbal kanker prostat

18. Sep 2014, 13:46 CET | Link

Pour la plupart des enfants, oméga aiguë ou grave replique montres douleur stylo réplique de Breitling est procédures invasives telles que raison d'une blessure ou d'une opération.

26. Sep 2014, 09:29 CET | Link
obat jantung bengkak

Penjualan Obat Herbal Penyakit Jantung Bengkak - obat jantung bengkak tradisional

20. Oct 2014, 12:57 CET | Link

Click HEL This is a great article thanks for sharing this informative information. HD mxf files conversion software mxf converter pdf conversion to Office pdf to word

31. Oct 2014, 10:44 CET | Link

The greatest interest of your ease is actul perception moreover salubrious network. It reminded me whereas I permit written custom essay service besides how gravely it was to discover improve expedients. Appears to me want you didn't retain such syndrome.

09. Nov 2014, 10:22 CET | Link

You have done a great job. I will definitely dig it and personally Home Automation Fort Lauderdale recommend to my friends. I am confident they will be benefited from this site.

29. Nov 2014, 05:53 CET | Link

ACE MAXS adalah produk herbal unggulan yang di produksi oleh PSB jakarta – Indonesia dan di distribusikan oleh PT.H2O Internasional – Jakarta. ACE MAXS diciptakan berdasarkan riset ilmu pengetahuan dari beberapa bahan herbal yang terbukti khasiatnya efektif dalam menyembuhkan berbaga

30. Nov 2014, 12:22 CET | Link

Also working with Walters and Bass is a producer named Holly Wiersma, who happens to be the wife of Hollywood agent Cassian Elwes. Elwes, whose brother is Cary (The Princess Bride, Saw) Elwes,Home Automation Fort Lauderdale once produced a film, Men at Work, written and directed by Emilio Estevez

03. Dec 2014, 13:05 CET | Link

These few points given above are the examples that mediocre SEO experts says to you. They are all seeking to make some money with no visible results for you. With these people, you end up losing money, time, and your motivation too. dampvask af bil aalborg

09. Dec 2014, 13:57 CET | Link
dampvask af bil Aalborg

Hello! This post couldn’t be written any better! Reading this post reminds me of my previous room mate! He always kept chatting about this. I will forward this page to him. Fairly certain he will have a good read. Thank you for sharing!

18. Dec 2014, 22:42 CET | Link

Very much valued, bookmarked, When i can’t wait for much more! We've simply just determined to manufacture a web site, which in turn antivirus protection