I. Introduction of Enterprise Architect
Enterprise Architect is a case software (Computer aided software Engineering) with excellent support for software system development. The EA is different from ordinary UML drawing tools such as Visio, which will support the whole process of system development. In the requirements analysis phase, the system analysis and design phase, system development and deployment of a strong support, coupled with the 10 programming languages of the forward and backward engineering, project management, document generation, data modeling and so on. It can make the best development efficiency for each role in the system development.
Ii. creation of new projects
After the EA is installed, launch the software. Click "Create new Project" To open the Create New Project dialog box.
"Figure 1"
Here you can choose from a variety of initial template packages.
"Figure 2"
We selected a few of them and then decided to open the project browser. Our project will begin here.
"Figure 3"
Third, the EA software configuration
Before using the software, let's configure it first. Open "Tools" –> "options".
"Figure 4"
General configuration, the more important is the author of this. Because in the team collaboration of the EA Project, the author is the identity of each person.
In code engineering, it's a good idea to set the file encoding to UTF8 or GB Chinese.
Other aspects of the configuration, because all are Chinese, but also more easily understood. Some unknown places, can be more pondering.
In addition, for the bottom 10 programming languages, you can do some configuration according to your own needs. such as PHP, can be configured PHP4 or PHP5, then the generated code is a bit different. You can also hide other languages that are not used.
Iv. use case diagram, class diagram
Case diagram (use cases)
Use case diagrams are the usual first step in our system analysis and are very important. After all, most of the development process takes demand analysis as a first step and is a necessary step. The system requirement is transformed into a pattern expression. First, in the project browser, right-click "Add" –> "New chart".
"Figure 5"
You can then add some characters and use cases, and each time you pull a component out of the toolbox, it will open the Settings dialog box for the component, filling in the dialog with information such as the name of the component. Now we are expressing a user registration and login scenario:
"Figure 6"
Joining associations, the most commonly used associations in use case diagrams are "using use" and, of course, often use "include include" "Extend extend". The difference between the two is that "contains" is that the main use case does not contain other auxiliary use cases and cannot be executed independently, but the main use case can be executed without "extending" other auxiliary use cases. For example, a registration is a use case that "contains" a check verification code, but does not necessarily "extend" the sending of a notification message.
A role is the basis of the behavior of a use case diagram. Although the role can be a person of a certain position, or a database, or an external system interface, each use case diagram begins with a role. A role can have a generic relationship. For example, registered users are also site visitors, registered users can do all the things visitors can do, but the registered users also have some site visitors do not have the features, such as log-in and send articles.
"Figure 7"
Class Diagram (classes)
Class diagram is the basis of code engineering, and it is also the main work of the system design part. The class diagram mainly embodies the detailed implementation architecture of the system. First, we will make a registered business class that implements the user registration function.
"Figure 7"
After generating the class, we can add some variables (right-click "Variable" on the class Element), and the variables will save some of the data of the class itself, like human gender, age and other data characteristics. For example, we register a class, there are data link variables (it needs to know which database to deal with), it may have a limit on the number of per-day registration of IP data variables and so on.
"Figure 8"
class also needs to add a method (right-click on the class element "method"), such as the registration class, you need to check the input verification code, need to do data operation, need to check the number of daily registrations and so on. In the method of the class, we can also set the parameters of each method, the parameter type, as well as the comment of the parameter, which will be generated in the code project directly as a parameter and a method of comments within the code file.
"Figure 9"
There may be some relationships between classes, so we use associations to express these relationships. There are common inheritance relationships (Generalize, or derived classes). For example, when registering, we may have some special registration methods, such as the registration of the person who received the VIP card number. VIP registration More than the general registration of a number of steps, such as verifying the validity of VIP card number. This VIP registration class, inherited from the registration class, has all the common functions of registration, but there are some of their own unique features, so that the code can reflect the reusability of. At the same time, when the code is generated, the keyword "extends" is added to identify their relationship.
"Figure 10"
V. Use of other graphics
"Figure 11"
Object graph, which is a supplement to the class diagram, mainly demonstrates the various classes in the system, in different scenarios, after the instantiation of the different things.
Interaction diagrams (interaction), collaboration Diagrams (communication), and time series diagrams (Timing), all of which represent interactions between some entities in the system. Collaboration diagram is a collaborative interaction between the focus and expression entities, in the new version of UML, collaboration diagram is also called the communication diagram, more can reflect the entity is a communication between the principle of collaboration. The time series diagram emphasizes the sequence of interactions between individual entities. For example, to send a successful notification message, it occurs after the registration class verifies the input data, but not before.
In addition, there are a number of other graphics, such as the state diagram, deployment Diagram (Deployment), Component Diagram (component), activity diagram, which refer to the relevant documentation. At the same time, the EA supports a lot of graphics, in which the mind map (expressing and supporting the thought process of thinking), the Web Model diagram (which shows the structure of the model deployed on the site) is only available in the last few releases.
Vi. Data Modeling
In data Modeling, the EA supports 13 different models of database modeling that can generate SQL statements directly, and can also import existing data table structures via ODBC.
"Figure 12"
In the following example, we set up a data sheet composed of a student's dorm staff, using MySQL for the table type. The first is to create a data table element and then set its properties.
"Figure 13"
Add a field (right-click "Variable" on the Table Element), set the field's data type, length, set to primary key, etc. Here you can use Chinese as the field name, in the "Alias" to write the English paragraph name, in the generation of SQL, select "Use available aliases" can be generated in English name field names.
"Figure 14"
To generate SQL for SQL, click the parent package for the data model, and select Project – Data modeling – Generate SQL code to open the dialog box for the build.
"Figure 15"
Once you've set up, click Generate to generate a complete SQL build table statement.
"Figure 16"
Vii. Code Engineering
Code engineering is to have already drawn a class diagram, using the EA to generate the corresponding code structure, is said to be the code structure, because the generated code, only the initial class structure and some preset values, the code inside the class method needs to be written manually. In addition, if you are in the settings of a class, or a variable, a method, or a method parameter, plus a comment, the Code tool will help you to generate neat code comments for all of these notes.
Using one of the previous PHP classes, select the right button "Generate code". The dialog box that generates the code is then popped up.
"Figure 17"
Once set, click Generate to generate the code structure.
"Figure 18"
The code generation process in other languages is similar. Code Engineering (forward engineering) generated code format, you can in the "set" –> "code project template" Inside the custom template modification.
Eight, reverse engineering
Reverse engineering is the original class library code, using the EA into the import class structure, directly generated class diagram. This is useful for system refactoring, or for creating new projects based on the old Project class library.
In the project browser, where you want to import the reverse engineering class diagram, right-click "Code Engineering" –> "Import source file directory" to open the Reverse Engineering dialog box:
"Figure 19"
When set, click Import. For a short period of time, you can import a class library. The following shows a class diagram that imports the speedphp framework version 1.5.
"Figure 20"
IX. Project Management
In the EA, not only support the entire software development life cycle, but also provide project management, such as personnel management, schedule management, risk management and so on.
Menu "View" –> "Project Management"
"Figure 21"
Here you can separately manage "(manpower) resources", "work", "risk", "measure" and so on several aspects.
X. Document Generation
The EA can generate very many types of documents to facilitate the creation of different focused documents for different situations and different reading objects. You can also have rich text formatting and HTML formatting choices.
In the Project browser, select a model node. Then right-click on "Document" –> "RTF document" to open the Generate Document dialog box.
"Figure 22"
There are several types of documents that can be generated here. Click "Generate". An RTF file is then generated.
"Figure 23"
The default generated document, which contains most of the English language. Of course, you can rewrite them in RTF files into Chinese. You can also use Word translation in the Generate Document dialog box to translate and generate a new translated document. You can also directly modify the document template in the EA, which can also produce custom documents.
Enterprise Architect Use Tutorial