Drawing a picture for a while, it becomes increasingly felt that the EA is a powerful software, not just a drawing tool so simple.
With the extension of learning time, now the code is not as arbitrary as before, think of what to knock on what, but to first draw (that is, the process of demand and thinking), but for now we, there will always be considered not comprehensive place, then hit the code when there are a lot of changes, and will be more and more, And the project acceptance of the code and drawings are to be accepted, so the code in the changes when the diagram should be improved accordingly, then with the EA drawing and code synchronization will save a lot of things.
First, draw the class diagram.
1. Create a new class, fill in the class name, remark and language.
2. Edit variables and properties
The attributes are basically not changed.
Then select the class diagram and right-click to view the source code preview:
4. Generate Code
5. Add to Program
So if the diagram and code are synchronized, by the class diagram to generate code, when we modify the code in VS, as long as the EA to select the class diagram, right-click Select Code synchronization, you can synchronize the code changes to the class diagram, corresponding to modify the class diagram, generate code again, you can update the code in VS.
For example, in VS, add a Vipcash attribute to basicdataentity, and then the code synchronizes with the results such as:
The strength of the EA is gradually emerging, good use of the material also, some good tools will greatly improve our efficiency, but this also should be based on enough knowledge and use, if put before, I do not bother to bird it ...
EA class diagram and code synchronization