Book a Demo

Author Topic: what is the best code synchronization algorythm?  (Read 4374 times)

survex

  • EA User
  • **
  • Posts: 76
  • Karma: +1/-1
    • View Profile
what is the best code synchronization algorythm?
« on: November 17, 2014, 10:15:45 pm »
Hi, I'm sure this question has been discussed a lot of times, but I didn't find any of them.

Say I have the project containing two classes: A, B. These classes are mentioned in some views.

1 - problem:
In code I renamed class B -> C
What should I do then? During synchronization EA tries to remove class B from model. Should I migrate all connectors from B to C manually?

2 - problem:
In code I remove class B.
Then during synchronization EA prompts me, that class B is up to delete. I ignore this action. Then I'm trying to resolve all views and other logic traces in my model without class B, and delete class B after that.

Is there any topic or workflow containing the best practices which solve the problems I mentioned or maybe anyone created it for himself?

Thank you.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: what is the best code synchronization algoryth
« Reply #1 on: November 17, 2014, 11:23:56 pm »
Rythm' and Blues (algorithm has its name from an Arab mathematician).

This is a general problem with all tools that just peep through a hole to discover what's outside. You will need to intervene manually in such cases. Eventually you can assist such a migration with a script (there is a quite recent post about such a element merge automation).

q.

survex

  • EA User
  • **
  • Posts: 76
  • Karma: +1/-1
    • View Profile
Re: what is the best code synchronization algoryth
« Reply #2 on: November 18, 2014, 12:57:38 am »
I think it's quite common problem and users have solved them already.

I'll try to ask again concreate question:
is it possible to duplicate all connectors from one element to another?
for example we have:
B->Z
B->X
and I want to copy all relationships from B to A, to have:
A->Z
A->X

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: what is the best code synchronization algoryth
« Reply #3 on: November 18, 2014, 04:48:54 am »
You can't do that out of the box. One way is to use the relationship matrix. Another way is to write a dedicated script.

q.

survex

  • EA User
  • **
  • Posts: 76
  • Karma: +1/-1
    • View Profile
Re: what is the best code synchronization algoryth
« Reply #4 on: November 18, 2014, 04:21:28 pm »
Thanks, and the main question,
I've just renamed class, it happens pretty often, so EA creates new class element and I should manually change former class element by new one?
This is routine can take all the time.
Is there any solution?

survex

  • EA User
  • **
  • Posts: 76
  • Karma: +1/-1
    • View Profile
Re: what is the best code synchronization algoryth
« Reply #5 on: November 18, 2014, 07:56:25 pm »
Answer to myself:

when source file has been renamed from A to B, one should:
- rename class element A to B
- change filename of A element from ../A.java to ../B.java

Strange for me, but I couldn't find [filename] property, because properties context window doesn't contain it.

qwerty

  • EA Guru
  • *****
  • Posts: 13584
  • Karma: +397/-301
  • I'm no guru at all
    • View Profile
Re: what is the best code synchronization algoryth
« Reply #6 on: November 18, 2014, 09:14:18 pm »
There are two properties windows: one you open with Enter and one floating window you open via the Element menu. Use the latter. It's EA...

q.