jira.codehaus.org

  • Log In Access more options
    • Online Help
    • Keyboard Shortcuts
    • About JIRA
    • JIRA Credits
    • What?s New
  • Dashboards Access more options (Alt+d)
  • Projects Access more options (Alt+p)
  • Issues Access more options (Alt+i)
  • Modello
  • MODELLO-60

Make modello self-generating

  • Log In
  • Views
    • XML
    • Word
    • Printable

Details

  • Type: Improvement Improvement
  • Status: Open Open
  • Priority: Major Major
  • Resolution: Unresolved
  • Affects Version/s: 1.0-alpha-11
  • Fix Version/s: None
  • Component/s: modello-core, modello-plugin-java, modello-plugin-xpp3
  • Labels:
    None
  • Complexity:
    Intermediate
  • Patch Submitted:
    Yes

Description

Following discussion (well, qui short discussion, but well, modello isn't much about disucssions right now):
http://www.nabble.com/-Modello--Providing-a-modello's-meta-model-t2084698.html

I'm aiming at making modello self-generating (ie be able to generate Java class / xpp-reader for modello using a modello - model).
Bootstrap problems should/could be taken care of by committing the generated code te SVN, so as to be able to build modello from scratch at any time. What's more, that would provide interesting, up-to-date documentation about modello.

So to do this, there are several steps to take:

  1. create the meta-model file (using current version)
  2. clean-up existing modello code
  3. implements missing features
  4. rewrite modello meta-model to fully support current modello syntax

I have already taken step 1 (this can already provide some nice documentation, available on http://dcabasson.developpez.com/maven/metamodel.html ).

That leads me to the following things on my TODO list:

  1. For step 2
    • Following attributes seems unused : deprecatedVersion, typeValidator
  2. For step 3
    • allow for imports/import in code segments (some code segments needs external import, such as exceptions)
    • refactor code to extract helper methods to other class? (as including codeSegments is, IMHO, much less understandable)
    • add support for metadata on some tag. For example, add an allowMetadata field on class and field level. (maybe an optionnal metadataName too)

There is probably some other things to be done, but that's my first list there....

Attach is first patch, providing a crude metamodel.

  • Options
    • Sort By Name
    • Sort By Date
    • Ascending
    • Descending
    • Download All

Attachments

  1. Text File
    MODELLO-60-modello-core.patch
    21/Aug/06 3:51 AM
    15 kB
    Denis Cabasson

Issue Links

relates to

New Feature - A new feature of the product, which has yet to be developed. MODELLO-145 Create an XSD for Modello

  • Major - Major loss of function.
  • Closed - The issue is considered finished, the resolution is correct. Issues which are not closed can be reopened.

Activity

  • All
  • Comments
  • Work Log
  • History
  • Activity
Hide
Permalink
Herve Boutemy added a comment - 04/Jan/09 4:47 PM

I created a complete Modello model in MODELLO-145 to generate xdoc and an xsd: you can see the result in the Modello site.

From this work, I can see now 2 main problems to solve if we want to generate Modello model with Modello:

  1. association: in the java code, ModelAssociation extends ModelField, but in the XML, association is only 2 elements (there is a trick in ModelReader.parseFields(...) )
  2. XML attributes: Modello treats them as an extensible way to have plugins add their metadata

Then I'm convinced that:

  • we won't be able to generate a reader with Modello, because of these 2 problems.
  • generating java model should be feasible, with some tricks to deal with these things:
    • association: differentiate a class in the model for java generation from the class for xdoc/xsd generation
    • XML attributes: I think that having each plugin define its own metadata model (containing XML attributes only), and a way to merge them with the core model is feasible (tricky though)

The benefit would be to have a good documentation in the models, that would be rendered simultaneously in xdoc, xsd and javadoc.

Show
Herve Boutemy added a comment - 04/Jan/09 4:47 PM I created a complete Modello model in MODELLO-145 to generate xdoc and an xsd: you can see the result in the Modello site. From this work, I can see now 2 main problems to solve if we want to generate Modello model with Modello:
  1. association: in the java code, ModelAssociation extends ModelField, but in the XML, association is only 2 elements (there is a trick in ModelReader.parseFields(...) )
  2. XML attributes: Modello treats them as an extensible way to have plugins add their metadata
Then I'm convinced that:
  • we won't be able to generate a reader with Modello, because of these 2 problems.
  • generating java model should be feasible, with some tricks to deal with these things:
    • association: differentiate a class in the model for java generation from the class for xdoc/xsd generation
    • XML attributes: I think that having each plugin define its own metadata model (containing XML attributes only), and a way to merge them with the core model is feasible (tricky though)
The benefit would be to have a good documentation in the models, that would be rendered simultaneously in xdoc, xsd and javadoc.

People

  • Assignee:
    Unassigned
    Reporter:
    Denis Cabasson
Vote (0)
Watch (2)

Dates

  • Created:
    21/Aug/06 3:51 AM
    Updated:
    04/Jan/09 4:47 PM
  • Atlassian JIRA (v5.0.4#731-sha1:3aa7374)
  • Report a problem
  • Powered by a free Atlassian JIRA open source license for Codehaus. Try JIRA - bug tracking software for your team.