Book a Demo

Author Topic: Source code synchronisation  (Read 5178 times)

Christiaan

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Source code synchronisation
« on: April 20, 2004, 05:01:21 am »
I would like to know how other users experience/use the code synchronisation in EA. I think that a good modelling tool should integrate with the code well to become really productive (model driven development). My personal experience with EA so far is that synchronisation is not as integrated as I would have hoped for. Reading other posts, I notice some other users have problems with it too. Some improvements I would like to have:

- Before we used EA, we used a modeling tool in which it was possible to view the differences between source code and model elements. (for intstance, when a class, method or attribute was added, deleted, or changed). As a developer I could decide per element whether I wanted to have the changes from the model or from the source code. This gave me a good sense of synchronisation control. In EA it is only possible to check the option if I want to delete attributes/methods in my model if they are not in the source code (I am new to this so maybe I am mistaken). I would really like an overview of all the differences per class, so I can decide which element (method or attribute) should be used as final (either from model or source);

- In EA I get several menu options for source code generation / reverse engineering:
     - Generate source code;
     - Import source directory;
     - Synchronize package contents;
     - Generate package source code;
     - Update package contents;
     - Import directory structure;
For me, there are too many options for what I want: a synchronisation between model and source (in a way I described in the previous item). I tried all of them to get what I wanted, but none of them was really satisfying and confused me a lot.
s

- In java there is a close relationship between packages and folders. Does EA support this relationship? For intstance, when I generate a class in package logical view - com - product - domain and set the root namespace to logical view, I would have expected an import statement in the class "import com.product.domain", however "import com" appears. (creating a package com.product.domain wouldnt be a solution since our developers also want to create classes in their IDE. When Importing this new class this still would generate a hierarchical structure

- Having the option to mark certain attributes as properties (thus generating getters and setters) is very useful. Moreover, EA offers the possibility to hide properties, making the model easier to read. Again however, if I code getters and setters (getAmount, setAmount) EA doesn't recognize them as properties of the amount attribute, leaving the model with a mix of getters/setters and properties.

- Sometimes associations are not generated when shown: I implemented several classes two of them are called Account and Money. The Account class has an attribute "private Money totalAmount", but no relation is shown when importing. (However for some other classes EA does generate the association??!!)

hoping Sparx will improve this,
Christiaan

Eve

  • EA Administrator
  • EA Guru
  • *****
  • Posts: 8090
  • Karma: +118/-20
    • View Profile
Re: Source code synchronisation
« Reply #1 on: May 24, 2004, 05:03:32 pm »
Hi Christiaan.

The code synchronisation feature of EA is under constant development, I really do suggest that you reguarly check for new releases of EA and at least read through the release notes of each version.

For example, your problem with the package statement only showing com has been fixed along with imports being generated for attributes (but not on synchronisation).

As for your list of changes, I can see the use of it, but it is also a fairly big bit of work to implement.  However, I couldn't rule out something like that from the future.

Generally speaking, if you have a concrete problem then you can email support and we'll see what we  can do.

Simon

JeffCarlson

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Source code synchronisation
« Reply #2 on: May 25, 2004, 03:02:34 pm »
I feel your pain Christiaan, as I also wish that the synchronization worked better.  I would like to design and refactor my classes via EA, but I can't fully.  The product will not remove anything from the class if I remove it from the model.  I can add things all day long and it does a nice job of leaving my existing code alone.  But in refactoring, I'm renaming and removing attribute and methods and I have to go and manually do it in the class as well.  There is the chance of missing things and that should not have to be the way to do it.  I'm almost better off doing the whole refactor in the IDE and then reverse engineering it to see the diagram.  Thats not realy why I bought this tool.  I think it is a great tool and it worked fine for my new projects.  But not everything is new.  I could let it replace the original file and then it would put only the methods and attributes that I want, but all of the meat of the methods would be gone and then I would be cutting and pasting to fix that back.  

I like Christiaan's idea about bringing up the differences and letting the user decide which to keep.  I also understand that that is a big code change.  In the interim, could we give a check box that would allow the delete from code for methods and attributes not in the model.  That would put the control in the Users hands and would make my life 150% better.

Thanks,
Jeff Carlson
Senior Analyst

sargasso

  • EA Practitioner
  • ***
  • Posts: 1406
  • Karma: +1/-2
  • 10 COMFROM 30; 20 HALT; 30 ONSUB(50,90,10)
    • View Profile
Re: Source code synchronisation
« Reply #3 on: May 25, 2004, 04:25:34 pm »
Quote
The product will not remove anything from the class if I remove it from the model.


...and please dont ever make it do that!

In its current format its a modelling tool not a refactoring tool.  While I appreciate what you are trying to achieve, it would certainly upset the way we (me) have been using EA.

Consider a class with 1.5 megaattributes and 2.3 megamethods (not uncommon in .Net).  In trying to solve a single problem we can simplify the model by removing the extraneous gumph and only modelling with the attributes and methods germaine to the issue.

The current incarnation of EA does not disturb the existing code when the solution is forward engineered.


As regards you original query, I have been particularly satisfied with the way EA round-trips for C#, VB and VB.Net.  There are some constraining issues with C++ that I know of (but then again, there are some straining issues in the language itself IMHO  :) ).  I have no experience with java so I am wondering if the pain you are having is localised to the java RE/FE engine?

rgrds
Bruce
"It is not so expressed, but what of that?
'Twere good you do so much for charity."

Oh I forgot, we aren't doing him are we.

JeffCarlson

  • EA Novice
  • *
  • Posts: 4
  • Karma: +0/-0
    • View Profile
Re: Source code synchronisation
« Reply #4 on: May 26, 2004, 06:46:45 am »
Well one, I'm using VB.Net and two, if it is an option that is selectable, then you can CHOOSE to use it or not use it BUT it is a valid option.  I too like that EA doesn't mess with the code in existing methods.  The purpose of a modeling tool is to model, that includes refactoring.  If the tool is only good for new projects then its not much of a tool.

This option does not have to be the default, but it is needed to make this tool COMPLETE.  If you and your team don't want it then don't select the option, but to say don't ever put it in is very self-centered.  I believe that you and your team are probably bright enough to not select that option if it was to be included and therefore it would never affect you.  If one of your team had a brain fart, then I'm sure if you have so much code, then you must have it in VSS or some other repository.  So you can just undo the check out and the mistake would be easily corrected.

We too have have thousands of classes and Drawings so huge that I'm tired of taping the D sized sheets together.  You can choose to hide virually any part of the classes from the diagrams and it won't affect the outcome of the generated class.
« Last Edit: May 26, 2004, 06:49:02 am by JeffCarlson »

Christiaan

  • EA Novice
  • *
  • Posts: 17
  • Karma: +0/-0
    • View Profile
Re: Source code synchronisation
« Reply #5 on: May 27, 2004, 12:24:17 am »
I agree, hiding functionality has nothing to do with code synchronization functionality. So maybe you want to post a request to improve that as well;)

Stating that a modelling tool has nothing to do with refactoring (or code sync in general) seems a bit odd to me. We don't model to have a nice model. We model because it helps in creating good software products more efficiently. A model and the underlying source code are not two worlds apart. The waterfall approach did that, and we learned from that. When our team develop develops a software product, we often switch between model and code and we want to keep those two in sync. I think we also learned from software documentation which does not reflect what is in the actual software product.

Btw, One class with so many attributes and methods??...doesn't that need refactoring? ;)