DataUml Design tutorial 4- code generation

Recommended for you: Get network issues from WhatsUp Gold. Not end users.

The DataUml generated code Design is very flexible, it is a form of template based code generation, do not know if the class structure of the word model is more difficult. Here I can only explain how to generate the code, the code template rules will be described in the next section.

  1,View code

1),The code template file selected software on the right, as shown in Figure 4-1.

Figure 4-1 

2),Select a class in the model, click the right mouse button to select the &ldquo check code; ” menu, you can view the generated code. As shown in Figure 4-2.

Figure 4-2 

2,Code generation projects

 Build the project code can be generated code file to the specified path.

1),Choose to generate the code model, right click on the “ ” appear Properties dialog box, select the &ldquo &rdquo tab; template. As shown in Figure 4-3.

 

Figure 4-3

2), Here we need to set up three places

Ⅰ,The add template: you can add more than one template file, here we add two template file. As shown in Figure 4-4.

Figure 4-4

We add the template template &rdquo “ NetUml; the dal.tt and model.tt two template

Ⅱ,Set path: we need to preserve the path set generated code file. As shown in Figure 4-5.

Figure 4-5 

The template path we set dat.tt to "d:\ my desktop, desktop \Test1", the template path set model.tt to "d:\ my desktop, desktop \Test2"

Ⅲ ,Naming rules: file template on the formation of life may not be the same, here we can name the rule set template. Here we set the template dat .Tt file naming rules as shown in Figure 4-6.

Figure 4-6

  At last the whole template settings as shown below 4-7


Figure 4-7 

3),Choose to generate the code model, click click the right mouse button, &ldquo code generation projects; ” menu item, as shown in Figure 4-8.


Figure 4-8

Finally, the system automatically generate code, as shown in Figure 4-9.


Figure 4-9 


Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download

Posted by Grace at November 14, 2013 - 8:19 PM