Book a Demo

Author Topic: Another question on code generation  (Read 3313 times)

scruffyduck

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Another question on code generation
« on: August 17, 2005, 12:07:27 am »
Hi All

I have noticed that the code generator (in VB.Net) adds a line inporting the view - for example

imports Logical View.LogicalModel.

This causes a compiler error becasue of  the space in logical view but in any case I don't want that line.

I am sure I have missed the switch to remove it - but any help would be much appreciated

thanks in advance

Jon
« Last Edit: August 17, 2005, 12:07:46 am by scruffyduck »
Jon

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8110
  • Karma: +119/-20
    • View Profile
Re: Another question on code generation
« Reply #1 on: August 17, 2005, 03:47:08 pm »
The line is being generated because the class being generated is using a class that appears in that package in EA.

If you don't want that line to be generated, set your package LogicalModel to be a namespace root.  See my post at http://www.sparxsystems.com.au/cgi-bin/yabb/YaBB.pl?board=general;action=display;num=1123596649;start=3#3 or the help page on namespaces at http://sparxsystems.com.au/EAUserGuide/index.html?namespaces.htm for more information.

scruffyduck

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Another question on code generation
« Reply #2 on: August 17, 2005, 11:12:54 pm »
thank you - that is what I was looking for

Jon

scruffyduck

  • EA Novice
  • *
  • Posts: 8
  • Karma: +0/-0
    • View Profile
Re: Another question on code generation
« Reply #3 on: August 18, 2005, 06:35:23 am »
Can you advise me on a couple more things

The instantiating objects.  
I tend to create an object when needed as (for example):

public object as New objectClass

I notice that if I reverse engineer VB.Net code containing these declarations then the attributes are correctly placed in the class diagram.   There does not seem to be a way to define the New keyword in the diagram.  If I forward engineer then I need to enter the New in Visual Studio.  Not a major issue but I wondered if I am missing a way to insert the new keyword

Entering standard code.  
I always have a constructor in my classes even if it only calls mybase.new()  Is there any way of adding this in EA or is that something I need to add in Visual Studio after I forward engineer the class?

Thanks

BTW just downloaded and testing MDG Link for VS and it really does seem to enhance the desing process - looks like you may be getting another slice of my money sometime soon  :)

« Last Edit: August 18, 2005, 07:25:20 am by scruffyduck »
Jon