Recently, I was working on a fee system for the cooperative version of the data center. I was responsible for drawing all the UML diagrams and documents, which is equivalent to my entire architecture. In addition, you can only provide documents and required interfaces to partners to avoid communication and read documents and write code. I thought, it should be detailed!
Later I heard that EA can generate code directly. I thought it would be much more convenient and I don't need to write the interface manually. Directly draw a picture and generate an interface, so that others in our group can see it clearly.
The following shows how:
(1) first draw a class chart in EA, taking the sqluserdal class as an example.
(2) modify the class details (name, change the language) and click OK.
(3) Add a method and give parameters, return values, and visibility.
Here, you need to edit the parameters and click the edit parameters button.
(4) generate code
Right-click the sqluserdal class and click Generate code. Such:
Enter the path and select the code type to be generated. Click Generate!
Next, let's take a look at the generated results (the desired method is directly generated ).
''************************************** * ********** '''Smile ''' group: song Xiao, Qiu Muxia, and Yang Chen Group ''Note: Class sqluserdal'' created on: 26-May 23-2014 16:46:02 ''version: 1.0 ''************************************** * ****** option explicit onoption strict on ''' <summary> '''user table class''' </Summary> public class sqluserdalimplements iuser''' <summary> ''' query User table ''' </Summary> ''' <Param name = "enuser"> user entity class </param> Public Function queryuserinfo (byval enuser userentity) as list (of userentity) queryuserinfo = nothingend functionend class 'sqluserdal
2. If you have drawn many classes that need to be fully generated, you can right-click the model created in the EA.
Click Generate source code:
The source code of the class is directly produced after all selections.
Effect:
Is it much more convenient. Lazy people tend to be very smart!
As you can see, the code I generated earlier already includes all comments for modules, classes, methods, and parameters. The following section describes the powerful comments of EA!