Book a Demo

Author Topic: RefactorEA  (Read 22069 times)

Neocortex

  • EA User
  • **
  • Posts: 34
  • Karma: +0/-0
  • "There is no I in Team America"
    • View Profile
RefactorEA
« on: May 24, 2009, 06:03:49 pm »
We have built an EA Tool called RefactorEA.

It is a work in prgress but already includes some neat functionality.
We intend to significantly expand upon the current functionality.

It has been designed within the confines of a specific project, so some functionality is specific to that domain.

There is no documentation but if you have patience we are happy to be contacted regarding any issues you find. If you are particularly interested, then we are happy to provide comprehensive documentation.

It is free for download, including source.
Contact us if you would like some specific functionality.

Here's the link:
http://neocortex.net.au/ComputerScience/Projects.aspx

Just click on the RefactorEA link on that page.

At that link is another tool we have developed called 'EA File Comparison Utility' ... this is a useful tool for comparing eap files.

Both of these tools are stable, and we are currently devoting a great deal of time to them.

The download includes a self-installing executable...but expects that there exists a C: drive on your machine.

The install is only for RefactorEA which is an EA add-in.
The EA file comparison util is a standalone executable and needs no install.

Best,
Neocortex
[email protected]
« Last Edit: May 31, 2009, 12:24:26 am by simon.leserve »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: RefactorEA
« Reply #1 on: May 26, 2009, 02:33:10 am »
Well done. [Pending a close look.]

But take a look at the source link for RefactorEA. You've got a mix of the local and HTTP addresses, though the file name is correct.

Thanks for providing such bold support for the EA community!
No, you can't have it!

Neocortex

  • EA User
  • **
  • Posts: 34
  • Karma: +0/-0
  • "There is no I in Team America"
    • View Profile
Re: RefactorEA
« Reply #2 on: May 26, 2009, 08:52:33 am »
Thanks a lot Midnight...!

What's the difference between the local and HTTP addresses?

I tried messing around with the url string like this:

"[http://neocortex.net.au/ComputerScience/Projects.aspx][/http://neocortex.net.au/ComputerScience/Projects.aspx]"

but it doesn't look right.

Best,
« Last Edit: May 31, 2009, 12:25:23 am by simon.leserve »

Neocortex

  • EA User
  • **
  • Posts: 34
  • Karma: +0/-0
  • "There is no I in Team America"
    • View Profile
Re: RefactorEA
« Reply #3 on: May 26, 2009, 08:55:54 am »
There's a bug in the RefactorEA install.

the string

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727

is hard coded, so will only install on machines with the .net framework in that location.

The bug is fixed but it can't be uploaded until tonight.

Best,
Neo
« Last Edit: May 26, 2009, 12:00:28 pm by simon.leserve »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: RefactorEA
« Reply #4 on: May 26, 2009, 11:22:31 pm »
Quote
Thanks a lot Midnight...!

What's the difference between the local and HTTP addresses?

I tried messing around with the url string like this:

"[http://neocortex.net.au/Pages/Programming.aspx][/http://neocortex.net.au/Pages/Programming.aspx]"

but it doesn't look right.

Best,
Try removing the "/" before the second "http" and see if that works. As it is written the address gets translated to something like "file://http://..." when it is sent to a browser.
No, you can't have it!

Neocortex

  • EA User
  • **
  • Posts: 34
  • Karma: +0/-0
  • "There is no I in Team America"
    • View Profile
Re: RefactorEA
« Reply #5 on: May 26, 2009, 11:25:39 pm »
man!

I tried but I can't get it to work right

...

[29th May, 6:56 a.m.] now I get it
« Last Edit: May 29, 2009, 06:56:21 am by simon.leserve »

Thomas Mercer-Hursh

  • EA User
  • **
  • Posts: 386
  • Karma: +0/-0
  • Computing Integrity
    • View Profile
Re: RefactorEA
« Reply #6 on: May 27, 2009, 05:31:58 am »
Could you briefly describe what this add-in actually does before one goes through the effort to download and explore it ... without documentation.  I'm certainly interested in refactoring as a general topic, but don't know what it means when applied to a UML model.

Neocortex

  • EA User
  • **
  • Posts: 34
  • Karma: +0/-0
  • "There is no I in Team America"
    • View Profile
Re: RefactorEA
« Reply #7 on: May 27, 2009, 06:08:40 am »
Hi Thomas,

Copy and Paste operations and attributes: from one class to another. From the contex menu on the project browser (Add-Ins/RefactorEA/Edit/...).

Copy and Paste Packages: complete package duplication into a new package. External references maintained. (Add-Ins/RefactorEA/Edit/...).

Copy element path to clipboard: in conventional backslash notation. (Add-Ins/RefactorEA/Edit/...).

Show/Delete redundant package elements: if element does not exist on any diagram within the currenly selected package. (Add-Ins/RefactorEA/Edit Use Case/...)

Push methods up to base class: poorly named "lift methods..." (Add-Ins/RefactorEA/Edit Use Case/...)

There are other functions that are specific to the project we are currently developing...but you won't find any of those usefull. Our team however has found the above functions very useful.

RefactorEA is still immature. But it is only a few weeks since beginning the project. If you give us the chance and the feedback and request specific behaviour then RefactorEA can become a great tool.

There is no company behind RefactorEA... it is free and will remain free. The source code is open also, so that anyone can modify it, or contribute to the project. Thanks very much Thomas for giving us [me]  :) the opportunity to describe RefactorEA in more detail.

Best,
Neo

cube1us

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: RefactorEA
« Reply #8 on: May 28, 2009, 04:56:05 am »
I have a suggestion for something that I think would be really handy to have in this tool:  merge elements.  The idea is you might have two elements (let's suppose, for the sake of simplicity, that they are the same type of element), but they are really supposed to be the same element.    You want to replace one with another.

As a first cut, probably all that would matter would be the connectors to those elements -- to replace references to one element in connectors with references to its "replacement" -- thus you would end up with a union of the connectors pointing to the desired replacement.

Probably just a matter of searching thru all of the connectors in the model, looking for a particular ElementID as the ClientID or SupplierID, and replacing it with some other value?

Neocortex

  • EA User
  • **
  • Posts: 34
  • Karma: +0/-0
  • "There is no I in Team America"
    • View Profile
Re: RefactorEA
« Reply #9 on: May 29, 2009, 06:46:56 am »
Hey Cube,

Merge Elements is a brilliant idea, so we implmented it.

RefactorEA v1.2 with Merge Elements is now available at http://neocortex.net.au/Pages/Programming.aspx

Thanks Cube for your input!
The feature is available from the Project Browser context menu.

... drats! forgot to delete the source element ... but otherwise please let us know how we can improve Merge Element and make RefactorEA even better.

Best!
« Last Edit: May 29, 2009, 06:52:11 am by simon.leserve »

cube1us

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: RefactorEA
« Reply #10 on: May 29, 2009, 06:56:40 am »
Yowza!!  We'll give it a try (we are still on EA 7.1 -- hopefully it will work at that level).

(We have license to upgrade -- just haven't done it yet).

 8-)

PS:  It occurs to me that maybe the delete should be optional -- I could see, perhaps, that sometimes someone might want to keep the one from which the connectors were removed, for some reason that doesn't occur to me right now.
« Last Edit: May 29, 2009, 07:04:35 am by cube »

Neocortex

  • EA User
  • **
  • Posts: 34
  • Karma: +0/-0
  • "There is no I in Team America"
    • View Profile
Re: RefactorEA
« Reply #11 on: May 29, 2009, 10:17:48 am »
bug: merge fails to reconnect all diagram objects from the source to the target. (to be fixed asap. ...)

cube1us

  • EA Novice
  • *
  • Posts: 12
  • Karma: +0/-0
    • View Profile
Re: RefactorEA
« Reply #12 on: May 30, 2009, 12:17:20 am »
Gave it a whirl on a simple case, and at least for that simple case, it seemed to do what I was looking for.  FANTASTIC !!!!

UPDATE:  Possible Bug:  After I had done a number of merges, I decided to run a project integrity check, and it found some problems.  As yet I have not reproduced it -- but something to keep on the lookout for.

Update:  I have now reproduced the problem.  Suppose one has a deployment diagram, with 5 nodes:  Node1, Node2, Merged, Node3A and Node3B.  Further suppose that Node1 (depends) -> Merged and Node 2 (depends) -> Merged and Node3A (depends) -> Node3B.  Then one does a merge:  source=Node3A, target=Node3B.   When a merge works, the diagram simply updates.  Under these conditions, however, there is a dialog box that asks if you want to save changes.  If you respond Yes, the Node3a -> Node3b connector is lost, and the model fails an integrity check.  If you reply no or cancel, the connector is lost, but the integrity is not compromised.  Hope this helps.

Query:  Can one work with this thing in Visual C# Express (hopefully), or would one need the full product?

One thing you might consider down the line if you have the time -- but I'm not sure how much work it would be.  Much of the refactoring functionality is only available in the project browser, and is quite "stateful".  For example, for merge, one must first select the source and target elements, and then select merge, as three separate steps.  A more intuitive way for this to work would be to select two (or maybe even more, denoting more than one source) elements, with the last one selected (the one that gets the larger diagonal hash boarder) to be the target element.  (For an example, note how "align" works).  Then one would just select Add-ins => ReFactor => merge from the right-click context menu.

But again, I'm talking frosting here.  The time that what is already there can save is very significant.  THANKS A BUNCH !!
« Last Edit: May 30, 2009, 12:36:52 am by cube »

Neocortex

  • EA User
  • **
  • Posts: 34
  • Karma: +0/-0
  • "There is no I in Team America"
    • View Profile
RefactorEA
« Reply #13 on: May 31, 2009, 12:23:46 am »
Hey Cube,

Thanks tonnes for the feadback!

The bug has been fixed.
Merge Elements can now be selected from the Diagram Context Menu too...like you suggested.

Only thing is I couldn't figure out how to determine the last selected element from a set...(I'll try and figure this out...but for now you'll just see a dialog box asking which of the two elements (haven't included functionality for more than two) will serve as the target.)

The bug was actually really bad. The logic entirely disregarded the possibility of a connection between the source and target (or vice-versa). Anyway, what I decided to do is leave connections between the source and target unmodified altogether (What do you think?)

Oh yeh...I was going to ask you what you thought the best creteria for "Sufficiently Similar" should be (i.e. to allow merging between two elements)? I initially thought it should be:

1. Same Stereotype
2. Same EA.Element.Type
3. Source and Target IDs differ

Then, I found I needed to really merge two elements that had separate stereotypes. Do you think it's necessary to consider stereotype at all? (it could be made optional.)

If you think of any other criteria we can put that in place.

I'm getting good test results accross all diagrams in which the elements participate ...

Thanks again for your anlysis, and support!

Best,
Neo


The latest version (RefactorEA v1.2.3) is posted at http://neocortex.net.au/ComputerScience/Projects.aspx

P.S. you'll have no trouble compiling and running the source from C# Express
« Last Edit: May 31, 2009, 12:45:53 am by simon.leserve »

«Midnight»

  • EA Guru
  • *****
  • Posts: 5651
  • Karma: +0/-0
  • That nice Mister Grey
    • View Profile
Re: RefactorEA
« Reply #14 on: June 01, 2009, 01:42:59 am »
Hi Neo,

The new project is named as version 1.3.2 as expected. However the source file is named as version 1.3.1. Are these the same, or is the source still catching up with the compiled version?
No, you can't have it!