Book a Demo

Author Topic: How to copy a class  (Read 3205 times)

jamessher

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
How to copy a class
« on: August 23, 2006, 01:26:03 am »
Hi, I would like to copy a class and create a new one obviously with a different name but with same attributes, operations, etc.
I cannot see how to do this. Edit->Copy in Project View would appear to be the most likely contender but the subsequent Paste does not work (only allows paste as a link).
Any help appreciated.
-- James

Jan ´Bary´ Glas

  • EA User
  • **
  • Posts: 408
  • Karma: +0/-0
  • Bary
    • View Profile
Re: How to copy a class
« Reply #1 on: August 23, 2006, 01:40:16 am »
The question is why you need it.
Think of one general class with all these attributes and operations and of two special classes.
OR solving your problem:
The way how to copy-paste things in EA is export-import(Strip GUID) feature.
Jan 'Bary' Glas

jamessher

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: How to copy a class
« Reply #2 on: August 23, 2006, 01:50:24 am »
Why I need it...
I have a class design and want to refactor it. I want to copy the entire original package and paste it as a new package name and then start to refactor the new package while still being able to see and compare with the original one.

I tried the export/import - it worked but I just lost a bunch of classes off my class diagrams and have to redo them :-( Not only is export/import mechanism for copy/paste a really clunky way to do it, it is also dangerous !

Thanks for your suggestion all the same.

-- James

Jan ´Bary´ Glas

  • EA User
  • **
  • Posts: 408
  • Karma: +0/-0
  • Bary
    • View Profile
Re: How to copy a class
« Reply #3 on: August 23, 2006, 01:54:35 am »
Seems strange. I have got no problems with exporting-importing packages. And for refactoring it is suitable (if working). Sorry, no more help from me.
Jan 'Bary' Glas

jamessher

  • EA User
  • **
  • Posts: 71
  • Karma: +0/-0
  • I love YaBB 1G - SP1!
    • View Profile
Re: How to copy a class
« Reply #4 on: August 23, 2006, 02:16:36 am »
No problem. Thanks for the help.