Skip to main content


Eclipse Community Forums
Forum Search:

Search      Help    Register    Login    Home
Home » Modeling » Epsilon » Code refactoring(Which language is more appropriate for code refactoring)
Code refactoring [message #1760511] Thu, 27 April 2017 19:42 Go to next message
Martin Paquin is currently offline Martin PaquinFriend
Messages: 21
Registered: July 2014
Junior Member
Hello

I have a model that represent a legacy source code. Program methods are large and I want to split code based on a specific statement in the code. When I encounter a specific statement I want to create a new method with code from preceding statement at the point where I encounter the last specific statement.

I don't want to create new objects other than the new method that will be kept in the same class.

Which language is the more appropriate for this task? EOL, ETL or EWL?

I have made a try with Flock, but I have a problem setting the model.

"Flock can produce unexpected results when the original model includes references to other models. Flock is ignoring these external references in your original model and proceeding."

pre {
    "Running ETL".println();
    var debug : Boolean = true;
}

// I do a simple change just to see how it works.
migrate  XASubRoutine {
    for (m in original.method) {
          original.comment = m.comment + " enhance method";
        }
}


I'm using Epsilon 1.4.0.201611012202

Martin

[Updated on: Fri, 28 April 2017 15:52]

Report message to a moderator

Re: Code refactoring [message #1760617 is a reply to message #1760511] Fri, 28 April 2017 22:06 Go to previous message
Dimitris Kolovos is currently offline Dimitris KolovosFriend
Messages: 2163
Registered: July 2009
Location: York, UK
Senior Member

Hi Martin,

If your source model is split across multiple files then Flock won't work so I'd go with EOL (EWL is a better fit for user-driven transformations).

Cheers,
Dimitris
Previous Topic:Some rules work other don't
Next Topic:How to get expression as string in Java?
Goto Forum:
  


Current Time: Fri Apr 26 02:34:19 GMT 2024

Powered by FUDForum. Page generated in 0.03391 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top