Code refactoring [message #1760511] |
Thu, 27 April 2017 19:42 |
Martin Paquin 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 |
|
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
|
|
|
Powered by
FUDForum. Page generated in 0.03391 seconds