royale-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Carlos Rovira <carlosrov...@apache.org>
Subject Re: Jewel Validator
Date Thu, 30 Aug 2018 10:31:32 GMT
One more thing.

About Validation Metadata, I'm talking about something like this [1]

For example:

[Length(min="5", max="50", message="{validator.length}")]
        public function get name():String {
            return _name;
        }


In this example "name" will be part of a ValueObject, so the data object
gets the rest of definition about what values are valid. And I think an VO
is the perfect place where this info and rules should go.

Then calling a validate method over the object should validate the
annotated properties and report a "true" or "false" and that value should
be used by UI components for visuals.

As well in a service controller and delegate you will check if is true or
false in order to trigger a call to your backend with the data.

What do you think?

[1] http://graniteds.blogspot.com/2010/01/new-in-graniteds-210-rc2-more.html

El jue., 30 ago. 2018 a las 12:26, Carlos Rovira (<carlosrovira@apache.org>)
escribió:

> Taro,
>
> another thing. Maybe you want to expose images in the example, since I see
> place holders, but there's no images
> I fixed today in compiler and in examples pom.xml the copying of "assets"
> folder to js-release. So if you have assets folder with images now that
> should be now in your js-release folder in your next compilation then you
> can upload to your server so we can take a look to that explanatory images.
>
> thanks! :)
>
> Carlos
>
> El jue., 30 ago. 2018 a las 12:01, Carlos Rovira (<carlosrovira@apache.org>)
> escribió:
>
>> Hi Taro!
>> really great! :)
>>
>> as Piotr said, I think the best way is to create a PR so we can take a
>> look at the code.
>>
>> As I comment various times in this list, I'll hope we can improve over
>> the Flex Validators. Let me explain:
>>
>> In Flex, Validation is attached to UI components and not to data to
>> validate. Instead of that Granite Data Services, had validation through
>> metadata
>> I think that approach was better, since you can "check" data in the data
>> object, and make UI components reflect if is valid of not in response.
>> But the validation could be done in a controller and not in the UI like
>> in Flex validation.
>>
>> I'd like to have this implemented in Jewel. Could we work together on
>> that front?
>>
>> Thanks! and waiting to know about your thoughts! :)
>>
>>
>>
>>
>>
>>
>>
>> El jue., 30 ago. 2018 a las 10:24, Piotr Zarzycki (<
>> piotrzarzycki21@gmail.com>) escribió:
>>
>>> Hi Taro,
>>>
>>> Many Many Thanks for that effort. Whatever you have the pull request is
>>> the best option, so go ahead and make it. We will review your code and
>>> provide any feedback.
>>>
>>> Thanks,
>>> Piotr
>>>
>>> czw., 30 sie 2018 o 03:14 Taro.Yu <yestaro@gmail.com> napisał(a):
>>>
>>>> Hello
>>>>
>>>> After study the JewelExample, and search the GitHub, I can't find
>>>> Validator
>>>> like Flex (only some test
>>>>  items in mustella/tests)
>>>>
>>>> So I try to write some validator beads for Jewel Components
>>>>
>>>> Here is live demo
>>>> https://z3idxk1hh5asgqpvhvftra-on.drv.tw/royale-heroes/JewelExample/
>>>> <https://z3idxk1hh5asgqpvhvftra-on.drv.tw/royale-heroes/JewelExample/>
>>>>
>>>>
>>>> <http://apache-royale-users.20374.n8.nabble.com/file/t55/Image1.png>
>>>>
>>>> How do I contribute it to Apache ? Just create Pull Request ?
>>>> do I need to prepare some document to explain the Validators ?
>>>>
>>>>
>>>>
>>>> --
>>>> Sent from: http://apache-royale-users.20374.n8.nabble.com/
>>>>
>>>
>>>
>>> --
>>>
>>> Piotr Zarzycki
>>>
>>> Patreon:
>>> *https://www.patreon.com/piotrzarzycki
>>> <https://www.patreon.com/piotrzarzycki>*
>>>
>>> * <https://www.patreon.com/piotrzarzycki>*
>>>
>>>
>>>
>>>
>>> *-- <https://www.patreon.com/piotrzarzycki>
>>> <https://www.patreon.com/piotrzarzycki>
>>> <https://www.patreon.com/piotrzarzycki>Carlos Rovira
>>> <https://www.patreon.com/piotrzarzycki>
>>> <https://www.patreon.com/piotrzarzycki>http://about.me/carlosrovira
>>> <http://about.me/carlosrovira>*
>>>
>>>
>>>
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
> --
> Carlos Rovira
> http://about.me/carlosrovira
>
>
>
>

Mime
View raw message