Efficient work-ea skills

Source: Internet
Author: User

Drawing is one of the most important parts in the early stage of project development. As a powerful modeling tool, EA integrates many automated tools, it is much easier to use than Rose, and is naturally sought after by many people. I have also introduced some powerful functions of EA-making work easier-ea class diagrams and Code Synchronization. Today I will introduce some simple but useful skills.


The first skill is to skillfully implement the interface class.

We defined the interface in the project, and then defined the methods in the interface. Let's take a project I am working on to demonstrate it:


Now define a class, such as cardmgr to implement the icardmgr interface, and select "realization ":


The method you choose to implement is displayed. We generally think that since it is a class implementation interface, we should select all and confirm. The following figure is displayed:



After the class picture is complete, we call the method (Message 1.5) in cardmgr when drawing the sequence diagram. We found that the method was repeated twice:


Of course, we can remove "display inherited methods" so that the inherited methods will not be displayed.

You may feel very good and convenient. So, if I talk about the situation, do you still feel convenient: If I have added the class method modifycardinfo to icardmgr, what should I do with cardmgr? I have also found many methods and finally found a shortcut Ctrl + Shift + O to reload the inherited method, so that we can:
But what if I delete a method instead of a method? CTRL + Shift + O can only inherit the added methods, but cannot remove the methods deleted from the interface. Therefore, you need to manually delete it. If the workload is heavy, it will take a long time. After a long time, the chance of errors will be greatly increased, and several mistakes may be missed.
After many experiments, I found a good method: Just draw the interface icardmgr, while cardmgr only implements icardmgr,Do not inherit methods,

There is no way in cardmgr. After code is generated by F11, you will find that there are also many methods in the cardmgr class. So you don't have to check those methods again. And the phenomena described above will not appear. Because there is no method in cardmgr when drawing the sequence chart, when selecting it, You can directly select the method to be read from the interface, and after changing the interface, because it is a method in the interface for direct reading, it does not involve the modification of cardmgr, which saves time and responds to the changes. It is just a matter of two, will you still work hard to draw the cardmgr class ??
The second technique is how to modify graphs in batches.In fact, if you have carefully read the blog post I mentioned above, you may already have some ideas. Yes, it is to apply reverse engineering and make good use of code synchronization. How can I change the suffix of all classes in the ibll layer from MGR to BLL? Will you make a silly modification ?? Let's take a look at the Code Synchronization function: first generate the code for the ibll layer: then select the generated path in the "generate source code based on package" dialog box and click Generate.
Then, use a file content modification tool to replace Mgr in all Cs files under the generated directory with BLL. (Or add CS to a project and replace them all .) I am using a tool here,
If you use code synchronization to change the class name, the result is not successful, so you only need to delete the original class, including the package, then use reverse engineering to regenerate the image: (the file name does not need to be modified here, because when EA generates a class image, it refers to the class method name or interface name in the file to be read, not the file name)
Select the directory where the class source code is located as the root directory. Select the corresponding language and click OK.
I succeeded. What about yours?


Well, this article is here. I am just throwing a brick and mortar, and there are still many skills that you need to explore and share in practice. I hope you will find good methods and skills, we can share it with you. We are in a happy age of knowledge sharing!

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.