2 Replies Latest reply on Jul 19, 2010 8:49 AM by jesper.pedersen

    moving validate capability to metadata

    maeste

      Hi guys,

       

      during re-design of our metadata I've seen validate methods in current org.jboss.jca.common.metadata.Metadata. This class isn't at the moment a metadata itself, but it'd more or less a metadataFactory where this utility methods have been added.

      I think we can move validate capability into metadatas itself, adding to our new JCAMetadata interface the method "public void validate() throws ValidateException".

      Moreover we can change, during this refactoring, a bit the validation control flow, adding intead of the previous proposed above to JCAMetadata the method:

      "public ValidationStatus validate();"

      where ValidationStatus is a simple pojo with 2 member: boolean valid; List<String> validationErrors;

       

      In practice I'm saying to move validation strategies as closer as possible to the object to validate and don't use exception to control the flow.

       

      If you'll agree I'll open a Jira linked to JBJCA-385 and I'll take care of this one too.

       

      bye

      S.

        • 1. Re: moving validate capability to metadata
          maeste

          Well the same apply IMHO to merge operation that is in org.jboss.jca.common.metadata.Metadata too. If we still need it (I'm not sure at the moment, but probably it will be) we can add an interface MergeableMetadata to be implemented by metadata for which make sense.

           

          Am I wrong?

           

          bye

          S.

          • 2. Re: moving validate capability to metadata
            jesper.pedersen

            The Metadata class is there to have a single point of access to all metadata - both ra.xml and jboss-ra.xml. And a merge of thoese.

             

            It also contains a simple method to validate the structure from a resource adapter level.

             

            Feel free to move this functionality around, but document the structures in doc/developerguide/en/modules/metadata.xml