You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@daffodil.apache.org by Mike Beckerle <mb...@apache.org> on 2021/12/21 16:57:24 UTC

New simpler DFDL Schema project file-system layout

Hi all,

In giving hands-on training on DFDL, I've discovered that the
recommended file-system layout for DFDL schema projects (here:
https://daffodil.apache.org/dfdl-layout/) has been an impediment to
students/users. This is due to the file-tree being quite deep and not
"CLI user" friendly because of the long file path names that must be
typed repeatedly.

Following the standard layout requires typing long tedious CLI command
lines like:

   daffodil parse -s src/main/resources/com/owl/xsd/mySchema.dfdl.xsd
src/test/resources/com/owl/data/myData.dat

What we want to type is more like:

    daffodil parse -s src/mySchema.dfdl.xsd test/myData.dat

I've converted the DFDL CSV schema example (here:
https://github.com/DFDLSchemas/CSV) to use simplified conventions
where this shorter command line works.

This new project layout is nearly flat, with just a "src" and "test"
subdirectory to navigate, yet retains most good properties:
* Schema projects can still contain built-in-self-test (BIST) that is
easy to run via 'sbt test', or 'daffodil test -iii test/mySchema.tdml'
* Schemas are packaged as jar files for reuse via managed dependencies
between DFDL schemas. (via 'sbt package' and/or 'sbt publishLocal')
* Schemas can be readily shared using online hubs like Maven Central
in exactly the same way that software packages are shared.
* Test-related materials are kept separate from the "real" DFDL schema
files, and are not packaged into the jars.
* IDEs like Jetbrains IntelliJ IDEA are able to discover the project
structure and work normally.

So please take a look at CSV here: https://github.com/DFDLSchemas/CSV
and send any feedback about these changes as replies to this message.

Thanks

Mike Beckerle
Apache Daffodil Project

Re: New simpler DFDL Schema project file-system layout

Posted by Steve Lawrence <sl...@apache.org>.
The daffodil-schema.g8 template has been updated to use this new simpler 
layout:

   https://github.com/apache/daffodil-schema.g8

To create a DFDL schema project with this layout, which includes an 
empty DFDL schema and example test files, download and install SBT [1] 
and run:

   sbt new apache/daffodil-schema.g8

This prompts for a some information about your schema and builds the 
layout. View the README in that daffodil-schema.g8 repository for 
information about those properties.

[1] https://www.scala-sbt.org/


On 12/21/21 11:57 AM, Mike Beckerle wrote:
> Hi all,
> 
> In giving hands-on training on DFDL, I've discovered that the
> recommended file-system layout for DFDL schema projects (here:
> https://daffodil.apache.org/dfdl-layout/) has been an impediment to
> students/users. This is due to the file-tree being quite deep and not
> "CLI user" friendly because of the long file path names that must be
> typed repeatedly.
> 
> Following the standard layout requires typing long tedious CLI command
> lines like:
> 
>     daffodil parse -s src/main/resources/com/owl/xsd/mySchema.dfdl.xsd
> src/test/resources/com/owl/data/myData.dat
> 
> What we want to type is more like:
> 
>      daffodil parse -s src/mySchema.dfdl.xsd test/myData.dat
> 
> I've converted the DFDL CSV schema example (here:
> https://github.com/DFDLSchemas/CSV) to use simplified conventions
> where this shorter command line works.
> 
> This new project layout is nearly flat, with just a "src" and "test"
> subdirectory to navigate, yet retains most good properties:
> * Schema projects can still contain built-in-self-test (BIST) that is
> easy to run via 'sbt test', or 'daffodil test -iii test/mySchema.tdml'
> * Schemas are packaged as jar files for reuse via managed dependencies
> between DFDL schemas. (via 'sbt package' and/or 'sbt publishLocal')
> * Schemas can be readily shared using online hubs like Maven Central
> in exactly the same way that software packages are shared.
> * Test-related materials are kept separate from the "real" DFDL schema
> files, and are not packaged into the jars.
> * IDEs like Jetbrains IntelliJ IDEA are able to discover the project
> structure and work normally.
> 
> So please take a look at CSV here: https://github.com/DFDLSchemas/CSV
> and send any feedback about these changes as replies to this message.
> 
> Thanks
> 
> Mike Beckerle
> Apache Daffodil Project