Yes, CND is specific to Jackrabbit for JCR 1.0. Unfortunately, there
is no standard data-centric way to define custom node types; all JCR
implementations do it differently. The JSR-283 draft includes the
CND format and an XML format in Appendices B & C, although I can't
find any reference in the non-appendices to using either of those for
defining custom node types. (JSR-283 defines a NodeTypeManager that
doesn't appear to support importing from CND or XML.)
As for these node type definitions, I have a few comments/suggestions:
- Overall, this looks very good! It's pretty simple, and it mirrors
the domain pretty well.
- The "java:metadata" type is actually a node type definition, not a
mixin (as the comment implies).
- Would "java:metadata" be more aptly named "java:type"? It should
also be explicitly recursive to allow a type to have nested types.
- As Michael suggested, all of the node types should either extend
from "nt:unstructured" or explicitly allow for any properties or
children.
- Supporting annotations would be pretty great capability, as that
would lend itself to a lot of useful analysis.
Have you given any thought to how to represent the packages?
Randall
On May 26, 2008, at 6:52 PM, Michael Neale wrote:
The only problem I see with CND which is so granular is that it is
currently jackrabbit specific (I think? I could be wrong, am a bit out
of date) - also a side issue is how to handle migrations if a new
field of data is needed.
On Tue, May 27, 2008 at 6:54 AM, Serge Emmanuel Pagop
<serge.pagop(a)innoq.com> wrote:
> Hi Randall,
> sorry for the long weeks without my response of your last post.
> That was
> because of stress in my current project.
> But this weekend I have taken a little time for the refactory of the
> java-source-artifact CND and also taken a look at the Eclipse JDT
> library to
> see how we can smoothly and sequently get informations from a java
> source
> file and I'm also thereby to see how to use the Abstract Syntax
> Tree (AST)
> framework to parse the java source. What do you thing about AST as
> a parser?
> Here is the refactory CND schema and lets me know if something have
> to be
> enhanced or if we miss some important elements for the first Java
> sequencer
> release . Next week I will start with the implementation of the Java
> Sequencer.
> /*
> * JBoss, Home of Professional Open Source.
> * Copyright 2008, Red Hat Middleware LLC, and individual contributors
> * as indicated by the @author tags. See the copyright.txt file in the
> * distribution for a full listing of individual contributors.
> *
> * This is free software; you can redistribute it and/or modify it
> * under the terms of the GNU Lesser General Public License as
> * published by the Free Software Foundation; either version 2.1 of
> * the License, or (at your option) any later version.
> *
> * This software is distributed in the hope that it will be useful,
> * but WITHOUT ANY WARRANTY; without even the implied warranty of
> * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> * Lesser General Public License for more details.
> *
> * You should have received a copy of the GNU Lesser General Public
> * License along with this software; if not, write to the Free
> * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
> * 02110-1301 USA, or see the FSF site:
http://www.fsf.org.
> */
> /**
> * @author Serge Pagop (serge.pagop(a)innoq.com)
> */
> //------------------------------------------------------------------------------
> // N A M E S P A C E S
> //------------------------------------------------------------------------------
> <
java='http://www.jboss.org/dna/java/1.0'>
> <
nt='http://www.jcp.org/jcr/nt/1.0'>
> <
mix='http://www.jcp.org/jcr/mix/1.0'>
> //------------------------------------------------------------------------------
> // B A S E T Y P E S
> //------------------------------------------------------------------------------
>
> //------------------------------------------------------------------------------
> // V E R S I O N I N G
> //------------------------------------------------------------------------------
>
> //------------------------------------------------------------------------------
> // N O D E T Y P E S
> //------------------------------------------------------------------------------
> /**
> * Formal paramter
> */
> [java:formalParameter] > nt:unstructured mixin
> - java:name (string)
> + java:type (java:primitiveType, java:referenceType) mandatory
> multiple
> /**
> * No Return type
> */
> [java:noReturnType]
> - java:noReturn (string)
> < 'void'
> /**
> * Integral type
> */
> [java:integralType]
> - java:predefinedIntegralType (string) mandatory
> < 'byte', 'short', 'int', 'long',
'char'
> /**
> * Floating point type
> */
> [java:floatingPointType]
> - java:predefinedFloatingType (string) mandatory
> < 'float', 'double'
> /**
> * Primitive type
> */
> [java:primitiveType]
> - java:booleanType (string)
> < 'boolean'
> + java:numericType (java:integralType, java:floatingPointType)
>
>
>
> /**
> * Reference type (TODO needs some enhancements)
> */
> [java:referenceType]
> /**
> * Field type
> */
> [java:fieldType]
> - java:description (string)
> - java:modifier (string)
> < 'public', 'protected', 'private'
> - java:declaredAs (string) multiple
> < 'static','final', 'transient', 'volatile'
> - java:name (string) mandatory
> + java:type (java:primitiveType, java:referenceType) mandatory
> multiple
>
>
>
> /**
> * Method declaration
> */
> [java:methodType]
> - java:description (string)
> - java:modifier (string)
> < 'public', 'protected', 'private'
> + java:resultType (java:noReturnType, java:primitiveType,
> java:referenceType) mandatory
> - java:name (string) mandatory
> - java:declaredAs (string) multiple
> < 'static','final', 'native', 'strictfp',
'synchronized'
> + java:parameter (java:formalParameter) multiple
> /**
> * Constructor declaration
> */
> [java:constructorType]
> - java:description (string)
> - java:modifier (string)
> < 'public', 'protected', 'private'
> - java:name (string) mandatory
> + java:parameter (java:formalParameter)
> /**
> * Mixin that defines the java source metadata
> */
> [java:metadata] > nt:unstructured mixin
> - java:description (string)
> - java:modifier = 'public'
> - java:declaredAs (string)
> < 'abstract', 'final'
> - java:name (string) mandatory
> + java:field (java:fieldType) = java:fieldType multiple
> + java:method (java:methodType) = java:methodType multiple
> + java:constructor (java:constructorType) = java:constructorType
> multiple
>
> P.S. Annatation is also one open issue
> -------
> |||| Serge Pagop
> |||| Senior Consultant
> ||||
> |||| JBUG Munich Founder
> ||||
> |||| innoQ Deutschland GmbH, Halskestr. 17, D-40880 Ratingen, Germany
> |||| Phone: +49 2102 77162-100, Mobile: +49 178 4049592, Fax: +49
> 2102
> 77160-1
> |||| Mail: serge.pagop(a)innoq.com, Web:
http://www.innoq.com,
> |||| Weblog:
http://www.innoq.com/blog/sp, JBug-munich:
>
http://www.jbug-munich.org
>
> _______________________________________________
> dna-dev mailing list
> dna-dev(a)lists.jboss.org
>
https://lists.jboss.org/mailman/listinfo/dna-dev
>
>
--
Michael D Neale
home:
www.michaelneale.net
blog:
michaelneale.blogspot.com
_______________________________________________
dna-dev mailing list
dna-dev(a)lists.jboss.org
https://lists.jboss.org/mailman/listinfo/dna-dev