Art Of Programming

musings by Dmytrii Nagirniak

Migrating Eco3 to Eco5

Just sharing my experience migrating large project (~170 classes in Business Objects ONLY) from Eco3 (Borland C# Builder and Together Modeler) to Eco5.
This outlines the problems I faced, I don’t want to dig into details and try to reproduce each case as I have had enough pain already. I also don’t care if it is by-design. I would describe the process not the migration but the copy-pasting.
  1. Code is not migrated. THE MOST of time is wasted doing copy-paste (in best case).
  2. Interfaces are not migrated (so I have to put all the interfaces back and because of 1 implement them).
  3. One-to-many association names are not preserved and default names are used. Breaks code. And no it is not even cross-package references. The association links 2 classes from same package on the same diagram.
  4. Some associations are not imported at all.
  5. The import process added attributes to classes that do not belong there. It definitely breaks runtime as mapping will not contain them (and yes, I discovered it later).
  6. The import does not preserve IsNavigable for some associations.
  7. Wrong migration of attributes in large hierarchy: the attribute in the middle of hierarchy has been put into its parent.
  8. Import the same package twice gives very weird result: it duplicates all TaggedValues, Constraints, and method parameters (not methods)! Better it said me that the package already imported and did nothing as I had to manually correct everything.
  9. The EcoSpace had to be reconfigured from scratch as there are too many changes from Borland.* to Eco.*.
  10. Ordered value for associations is not preserved in some case (discover very late when could not make couple of tests pass).
I spent more than one and a half day for all that and now I can compile my model AND tests project. I still have some things marked with ObsoleteAttribute, but I’ll get to it later as I will be doing refactorings.
The issues I have faced making all my tests to pass (related to ECO only):
  1. I cannot longer use custom class as type of an attribute (custom Money class). This is a real showstopper. Why newer version supports LESS! I had to use Decimal instead of custom class. 
    Attribute ClassName.TotalCostsAmount has an invalid type: Shared.Money. Only arrays, enums, strings and valuetypes are allowed
  2. Significant OCL syntax changes that breaks the runtime. It cannot be detected at compile time as OCL is just a string. Best example:  “self.Name->trim(true, true).length > 0”. which trims the string on both sides (indicated by boolean parameters). Now it should use normal .NET Trim method: “self.Name.Trim().length > 0”.  (I missed to install my trim OCL operation).
  3. HasUserCode on associations is not available. That was simple way of doing things (thou you have to prohibit explicitly other ways of changing associations). Now I have to implement ISingleLinkCatcher. Much better in terms of functionality but much worse in terms of maintenance.
  4. The bug is still not fixed (derived attribute that uses externalId is not invalidate if it changes).
  5. The logging has not been improved.
Usability issues on with the UML designer
  1. Cannot specify additional namespaces to be used for the whole package (so I have to go through every class).
  2. Code generation takes a lot of time for simple change (2 minutes). It is related to the migration as during this process I often have to regenerate code and it just kills my time.
  3. Cannot select MANY objects (properties, methods, associations) and change values for all of them. Instead have to go one by one (Don’t tell me I have to use the AutoForm!).
  4. Sometimes the Modelr just freezes. It SHOWS the model but it is READ-ONLY. I cannot even select anything on it. VS restart helps.
  5. Cannot search class on the diagram (“select as you type” kind of thing). There is search for the whole model but not on a single diagram.

The outcome

  • About 12 hours to migrate the model and compile project.
  • About 4 (16 in total) hours to make ~40% of tests to pass.
  • About 4 (20 in total) hours to make ~90% of tests to pass.
  • About 2 (22 in total) hours to make all tests to pass EXCEPT ONE.
  • About 2 (24 in total) hours to make the last test to pass (related to the fact that I no longer use the Database for unit testing).

Breathing out

At the moment of writing this I have my new ECO5 business objects and all the tests working.
The migration process has not yet finished for the application in total but the major step is done and I can tell that I am happy with the overall result despite some frustrations.
The biggest frustration is that I had to copy-paste old code to new objects. It probably took at least 80% of my time.
Next thing is to migrate small WinForms utility. Will see how I go with it.

Last Note for those who does not want to write unit tests

It took me 3 working days to migrate all my system core with tests. Additionally tests were just a healthiness indicator. I am confident that without unit tests it would take at least one-two weeks in best case scenario.
So guys: “”Stressed? Write a test!”.

Comments