Book a Demo

Author Topic: C# to Java transformation  (Read 2899 times)

MaximK

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
C# to Java transformation
« on: October 17, 2013, 12:13:09 am »
Hello All,
   My task is to generate java classes from the C#. I'm using EnterpriseArchitect 9.3 for this purpose. First, I've imported the source directory of the C# project (Code Engineering => Import Source Directory) - no problem. The next, I tried to generate the XML schema for the newly created model (Code Engineering => generate XML schema). But, according to what I can see in the output, every package is described in a separate .xsd document, each in its own namespace, no relations are introduced (via <xs:include>).
  How to prouduce a (logically) one schema for the entire model?

Thanks in advance,
   Maxim.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: C# to Java transformation
« Reply #1 on: October 17, 2013, 09:48:30 am »
You'll need to write a transformation that flattens the package structure (and probably adds the appropriate xsd stereotypes etc as the XSD generation doesn't really expect to work from C# classes.)

PS. The name of your topic is C# to Java transformation?

MaximK

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: C# to Java transformation
« Reply #2 on: October 17, 2013, 07:21:58 pm »
Thanks for your answer, Simon!
  Yep, probably, I've incorrectly entitled the topic.. Finally, I need a java-generated classes, and I think the intermediate step should be an XML schema. Unfortunately, I have no experience in writing custom transformations in EA =(
  Reading the official help also doesn't give a direct answer how to do this in my case. Maybe you have experience in it? If yes, please share

Many-many thanks!
   Maxim.

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: C# to Java transformation
« Reply #3 on: October 18, 2013, 08:55:56 am »
I can't go into too much detail. The transform templates loop over one model and generate a textual representation of a new model (that EA then imports)

Have a look at the supplied templates and run them on simple classes to get a feel for it.

If you want to see the kind of thing that is possible, have a look at the WSDL transformation.