db-jdo-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Craig Russell (JIRA)" <j...@apache.org>
Subject [jira] Commented: (JDO-615) MetaData specification API
Date Fri, 12 Dec 2008 17:16:46 GMT

    [ https://issues.apache.org/jira/browse/JDO-615?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12656070#action_12656070

Craig Russell commented on JDO-615:

> - FetchGroupMetadata: Boolean getPostLoad(); 
> - IndexMetadata: boolean getUnique(); 
> The attached patch BooleanProperties.patch changes the above signatures. 

I agree with this patch. These are now consistent with the B vs. b rule and it's ok by me
to check in.

> About the newXXX method w/o arguments: 
> I agree to not add these methods, because it would bloat the interfaces. However, I think
it should be legal to pass null when constructing the instances as along as the required values
are defined when the metadata is registered (using method registerMetadata).

This is a good compromise. If building the metadata in a program, or responding to UI input,
the required fields are known up front. But for deferred required processing, the use-case
is tools that parse an xml file and build the model while parsing. For example, when the start-element
for field is reached, the name attribute hasn't been processed, so the parser handler needs
to create a field metadata without knowing the name. 

But by the time the metadata is registered for use, the required features need to be valid.
I'll note this in the spec.

> MetaData specification API
> --------------------------
>                 Key: JDO-615
>                 URL: https://issues.apache.org/jira/browse/JDO-615
>             Project: JDO
>          Issue Type: New Feature
>            Reporter: Andy Jefferson
>             Fix For: JDO 2 maintenance release 3
>         Attachments: BooleanProperties.patch, jdometadata-6.patch
> We can specify MetaData via XML or annotations. The only way missing is via an API. I
propose mirroring the XML structure with interfaces of the form
> public interface MetaData
> {
>     addExtension(String key, String value);
>     removeExtension(String key, String value);
>     ...
> }
> public interface FileMetaData
> {
>     addPackage(PackageMetaData pmd);
>     ...
> }
> public interface PackageMetaData
> {
>     addClass(ClassMetaData cmd)
>     ...
> }
> public interface ClassMetaData
> {
>     addField(FieldMetaData fmd)
>     ...
> }
> public interface FieldMetaData
> {
>     setInheritance(InheritanceMetaData inhmd)
>     ...
> }
> and so on.
> We would then require a method on the PMF to register the metadata.
> If there are no objections to such a feature I'll propose a patch to try to provide all
current JDO2 capabilities.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

View raw message