Sparx Systems Forum

Enterprise Architect => Suggestions and Requests => Topic started by: ondrej.krajicek on August 10, 2007, 01:39:08 am

Title: Code generation - documentation
Post by: ondrej.krajicek on August 10, 2007, 01:39:08 am
Hello fellow architects,

at our company we are using UML modeling extensively in our development process. UML models are used and treated as specifications and they are also used to generate developer documentation. However, we currently have to use "Notes" to write our documentation to individual elements.

Since we are using structured documentation (preconditions, postconditions, invariants, constraints) when specifying, we tried to use the respective parts of the element properties in EA. However, the contents of these parts is not taken into account in code generation. The only field which is put into generated comments is the "Notes" field. Would it be possible to enhance the code generation to generate more structured output and take into accout more properties?

Regards,

Ondrej Krajicek
Title: Re: Code generation - documentation
Post by: Paolo F Cantoni on August 10, 2007, 03:21:08 pm
Excellent idea Ondrej,   Gets my vote!

Formally request a feature from Sparx.  You can use the
[size=13]Feature Request[/size] (http://www.sparxsystems.com.au/support/feature_request.html) link via the Support link at the top and bottom of the page.
Place a reference back to this topic in the feature request.  That way, the Sparxians can see any ongoing discussion.
If you get a response, please add it to the topic.

Paolo

Paolo
Title: Re: Code generation - documentation
Post by: «Midnight» on August 13, 2007, 03:11:06 am
And add my support too!
Title: Re: Code generation - documentation
Post by: m.doering on August 21, 2007, 03:48:59 am
Here is yet another user crying for structured annotations!
Title: Re: Code generation - documentation
Post by: dbax on August 21, 2007, 06:09:28 am
Yes, yes and yes - this gets my vote too!!!
Title: Re: Code generation - documentation
Post by: thomaskilian on August 21, 2007, 11:00:50 pm
Quote
...  You can use the Feature Request link via the Support link at the top and bottom of the page....

I once used that but never ever had any feedback. :-X
Title: Re: Code generation - documentation
Post by: ondrej.krajicek on August 22, 2007, 12:19:15 am
I have submitted the feature reqest some time ago and still waiting for any reply or feedback :-(.
Title: Re: Code generation - documentation
Post by: thomaskilian on August 22, 2007, 04:03:19 am
Ooops. Have we detected another black hole ???
Title: Re: Code generation - documentation
Post by: KP on August 22, 2007, 05:16:49 pm
Quote
Ooops. Have we detected another black hole ???

We don't reply to feature requests but we do read every one of them and we keep them all on file until they are implemented (obviously, they don't all get implemented).

If you need a reply, send in a support request rather than a feature request. We always try to reply to support requests, and will send them to the feature request bucket too, if appropriate.

HTH
Title: Re: Code generation - documentation
Post by: thomaskilian on August 23, 2007, 01:17:38 am
That helps. I wasn't aware that this is kind of a pull interface :-/

Just an informal request. As you keep track of it, why not send a short email to the requestor once you work on it - or decide to not implement it?
Title: Re: Code generation - documentation
Post by: «Midnight» on August 23, 2007, 06:15:22 am
Quote
Just an informal request. As you keep track of it, why not send a short email to the requestor once you work on it - or decide to not implement it?

That would be a big help!
Title: Re: Code generation - documentation
Post by: ondrej.krajicek on August 23, 2007, 06:19:28 am
Back to the topic of this thread... EA has relatively powerful templating system for code and doc generation. It seems that it should be possible to achieve this by custom templates. However, I haven't been able to find any documentation regarding the template language syntax.

Is it documented somewhere?

Regards,

Ondrej Krajicek
Title: Re: Code generation - documentation
Post by: «Midnight» on August 23, 2007, 06:25:53 am
There is some documentation in the help files, under Code Engineering and MDA Transforms (as at Build 815). Also check the Resources page on the Sparx site. You might also want to browse the EA Wiki.

It looks like the EA SDK (currently in beta, search the forum for more information) will be the place to look for this in the future.
Title: Re: Code generation - documentation
Post by: Uffe on August 29, 2007, 09:28:35 pm
Hey guys,


Regarding the MDA Transform and Code Template Framework documentation, what's in the help covers the functionality pretty well (although there are one or two omissions such as the ability to pass parameters to a code template). The help files, along with some study of the templates for a language you're familiar with, should have you up and running pretty quickly.

However, in the Code Template Framework, there is currently (7.0.815) no way of accessing the properties from the Constraints tab of the Attributes dialog. Most everything from the General and Detail tabs is available, but the Constraints aren't. So custom code generation templates won't help.

Also, since there are an unspecified number of constraints rather than a simple tickbox or similar, and you'd want to be able to @list over all your constraints, presumably this would require a new template type and not just a new field substitution macro. This might make it harder to implement, I don't know.

One possible workaround would be to use tagged values instead. Tagged value macros are available so you can pull the information out, and you can create your own UML profiles wherein you specify the tagged values your classes require. Not a perfect solution, but it's something.

Cheers,


/Uffe
Title: Re: Code generation - documentation
Post by: gluzm on November 27, 2007, 03:37:10 pm
It will be awesome if such functionality will be available. I would love to have the constrains available in the template.

For generated test JML or C# OCL it needs to go into notes section, and this is horrible practice :( , the other alternative is to use XMI to generate the code.

Some links about why it is so important:
http://www.ewebsimplex.net/csocl/ or
http://ftp://ftp.cs.iastate.edu/pub/leavens/JML/jmldbc.pdf