Combination of TOGETHER and Visual.studio.net (reproduced)

xiaoxiao2021-03-06  62

G combination with Visual.studio.net

Author: bnPYSse (Original)

1, Borland Together Edition for Microsoft Visual Studio .NET installation TOGETHER is a cross-platform UML tool, I chose Borland TOGETHER Edition for Microsoft Visual Studio.net Version 1.0 version, from readme, its last update time is August 28, 2003, everyone can download it on Borland's website. Register. The registrar must support JDK.v.1.3, make sure that Java running package is installed on your machine. There is nothing to say, all the way next. Then start VS.NET, if the installation is successful, see the following screen (Figure 1): Figure 1: Boland together Edition for Microsoft Visual Studio .NET installation interface and then execute: Registry Together vs .NET menu command, will be generated The registration number is registered. If the registration is unsuccessful, you can use the License Managerment menu command to delete the invalid registration number, and regenerate (I also first unsuccessful, and then register successfully after registration). 2, brief introduction of Borland Together Edition for Microsoft Visual Studio. NOSOFT VITHER Edition for Microsoft Visual Studio. NET The main features include the following: UML modeling, two-way code generation, mode support, HTML document generation, import, XML format The main features of the main functions. The desired software platform, of course, the primary thing is that the programming language that has been installed on your machine and successfully runs Microsoft Visual Studio .NET 2003 and the programming language used is C # .NET. In addition, the demand for hardware is not too high: Pentiumiii / 500MHz, minimum memory 512m, 30m disk space, SVGA 1024x768, and operating systems that require W2K SP2 or WinXP Professional. Borland TOGETHER Edition for Microsoft Visual Studio .NET is not a separate running program, but is integrated into the environment of VS.NET, there are three major components: the first part is Model View (model view, Figure 2), The second part is Digram View (chart view, Figure 4), and the third part is the attribute window (Figure 3).

Figure 2: Model view

Figure 3: Attribute window

Figure 4: Chart View 3, by instance to apply to TOGETHER to see how to apply together in the vs.net environment. This example is quite simple, it simulates the implementation model of a audio and rental store. It involves two Actor mainly: one is a clerk, one is a customer. The clerk is mainly to realize the management function of the interior video, and the customer is mainly the function of realizing the rental tape. First, create a new project file in VS.NET: Video Store (Figure 5).

Figure 5: Create a new VS.NET project file

Then VS will create a new project file video. Select View -> TOGETHER VS .NET MODEL View menu command opens a Module view (this is a default view generated by TOGETHER for the new project file, Figure 6): Figure 6: MODUL view in the default item Create User case (Use case diagram), select default-> video_store-> add-> Other Diagram (Figure 7): Figure 7: Creating a User Diagram (Use Case Diagram) Together Popked a dialog box (Figure 8) , Enter Video Store Use Case to create an example of example: Figure 8: Creating a user diagram Note: If you open a project file that has been established, if you want to apply together, then in the Project Manager ": together vs .NET Support, a dialog box will pop up (Figure 9), select it, then confirm to open an existing module file (Figure 10).

Figure 9. Open together on the existing project

Figure 10: Application to Existing Projects Together

After the creation is successful, select the example of the example, which will display a special table tool in the toolbox on the left, including: actor, use case, communicates, extends, include, generalization, system boundary, pattern, note, note link, etc. Several, we choose an actor to add it in the example of the example and change its name: Clerk to represent the salesperson. You can double-click the icon or select the F2 key to change the name. When you are selected, there will be a border in the surrounding, or you can drag the border to adjust the size of the graph. Select "System Boundary Button", make a system boundary in the figure, and rename "Inventory System", use "Uses Button", create two use cases in the system boundary, one is "Find item by keywords", one is "Find Item By Title", represents two different use cases of the video tape by the keywords, respectively. Select "Communicates Button", select the actor (Clerk) in the figure, and drag it to use case (Figure 11): Figure 11: Select the actor (Clerk) with an example example, press the F4 button, you can open the right (By default) Properties window, select General-> STEREOTYPE on the right side of the right side (Figure 12), will pop up a dialog, please select the original shape of the role, we can choose Manager here (the representative is Manager, Figure 13):

Figure 12: Attribute window of Clerk

Figure 13: Defining Clerk's STEREOTYPE

Add a new use case Rent Item to System Boundery, add an Actor-Customer and use Communicates Link to connect Customer and Rent Item. The example of final formation is shown (Figure F4): Figure 14: Example of rental tape Figure 3 Open the default map (), select Class () in the toolbox, then create a class "Store" in the figure. Select this object, press F4 to open the property window, click the button on the right side of Stereotype to select the prototype "Place" (place, indicate the nature of the video store), repeat the above steps, set the Clerk "Role", will " Item "is set" Description ". Alternatively, you can click right click directly, select Add-> Class, or in the Model view, right-click the root point, then select Add-> Class. The static class diagram is completed, as shown in Figure 15: Figure 15: Initial static class map is a class Create member: Right-click the Store, and select Add-> Field, add a new property and assign it: address: string . Click the F4 key to pop up the properties editing window, click on the Visibility field in which the private property is selected from the drop-down list. In the default, TOGETHER VS.NET creates public int domains and public void methods. Add a method for the Store, right-click the Store class and select Add-> Method, and use the embedded editor to name: findbytitle. Refer to Table 1 for the properties and methods of the various classes filled. The final Store is shown in Figure 16:

Figure 6: Composition of the Store class

ClassfieldSmethodsstoreaddressFindbyTitle StorenumberfindbyKeywords HoursfindByItemNumbercleMnumbergetItemNumber TitleSetItemNumber GetTitle Settitle

Table 1: Attributes and methods of various types

Figure 17: Set the gender name

You can add an attribute to the Ctrl W key to add a method to add a method and use the F2 key to make a naming or rename work. Select the StoreNumber property, you can set its alias in Alias ​​in the properties window, such as "Store Number", as shown in Figure 17. Of course, you can also set a Chinese alias to facilitate communication. Click Right click to select Goto Definition You can view the code generated by Together (Figure 18) Figure 18: TOGETHER Automatically generate code and aliases create relationships and connections. There are two relationships in this example: First, Clerk is associated with the Store, and the Store includes several items. The relationship between Clerk and the Store is similar to the relationship between "customers" and "vendors", and for Store and Items are obviously a aggregation relationship. Click the Association Link button, then click Store and drag to Clerk, this behavior will establish a relationship between the so-called customer and suppliers (Figure 19): Figure 19: Building a relationship between Store and Clerk In Store and Item Another new association, use the properties window to define the type of connection, define the aggregation property from the Type property. Create a hyperlink. Video Store There is a method FindbyKeywords to find a tape. By using a hyperlink, you can quickly determine the relationship type of the chart and the element and record it in the model for other use cases. Open the case, right-click "Find Item By Keywords" case, select Hyperliks-> Edit, a dialog box appears (Figure 20), select Video Store-> Store-> FindbyKeywords from the "Available Content" panel, then click The Add button adds the selected element to the right panel, click OK, at this point, the newly established Symposium is displayed in blue font (Figure 21).

Figure 20: Super Link Dialog Figure 21: Creating a sequence diagram of the use case to create after completing the hyperlink. The sequence diagram is used to design the dynamic effect of the object model. In the Model view, right-click the Video Store root node, add-> Other Diagram, select "Sequence Diagram" in the pop-up dialog, rename "Rent Movie Sqquern" and click OK. Select "UML Interaction Diagram" from Toolbox, click the actor button, place it to the figure, rename "Clerk", click the Object button, and click on the right side of the Actor Timeline to rename the object "thisstore". Click on the "Message" button in the tool box to add a message connection and drag the timeline from the Time line of the Actor to complete the sequence diagram (Figure 22):

Figure 22: Sequence diagram Right-click the Theestore object, select the Choose Class-> Store, the final sequence diagram will be displayed, pay attention to the object name at this time has been associated with the corresponding class. Click the message chain, select Choose Method-> FindBytitle (): Void, link the message chain with a method (Figure 23): Figure 23: Message chain and method to associate between sequence diagrams and collaboration Conversion. Right-click on the sequence diagram, select the "Show as Collaboration" menu command, open the collaboration map, at which point, the mapping tool related to the collaboration diagram is displayed in the toolbox. On the collaborative figure, right mouse, you can convert to the sequence diagram via the context menu. 4, one of TOGETHER extension applications: Support to support together to support common mode, like "Four Help" (this word may only think about our Chinese program, huh, huh, huh, huh, huh). The famous 23 design model. Designers can use patterns to create or modify existing connections and classes. In the following example, assuming that ITEM requires a dynamic system, then an ITEM is returned, the counter is updated and other systems are notified. These features can be implemented using OBServer to the Item class. Right-click the Video Store class diagram, select "Apply Pattern", a mode wizard dialog open (Figure 24): Figure 24: Pattern Wizard dialog from the left Patterns panel, select Gof-> BehavioR-> Observer Mode, in the right pattern attribute, change the Class Subject name to Item, accept the default attribute settings, click OK, then change to Figure 25:

Figure 25: Applying Observer Mode The class map Item is updated, including notification messages and observation methods (Attach and Detach), and other desired classes and interfaces are also created. TOGETHER organizes this mode and other visual elements with an elliptical, listing the participants and connections, and can observe the participants by expanding Participants in the elliptical OBServer element. Right-click on the Observer element and select ADD to observe the effective action of special mode. 5, TOGETHER's extension application 2: Generate Document TOGETHER to generate a standard HTML document for the project. In the Model view, right-click the root node of the project, select Generate Documentation, find a dialog (Figure 26: Document generation dialog is default, the document generation wizard is the entire project Generate a document that limits the generation range of the document by selecting a different range option. Including the following: CURRENT NAMESPACE: The generated document output includes only the namespace selected in the Model view; the Current Namespace with DescendNT Namespaces: The generated document input includes the namespace selected in the Model view; CURRENT DIAGRAM: The generated document is output to the current focus view in the chart view; all: The generated document output overwrites all items. The selection includes: Output Folder: The target path output for the generated document; INCLUDE DIAGRAMS: Whether the generated document output includes an image; include Navigation Tree: Whether the generated document output includes a navigation tree; Launch HTML Browser: Whether in Visaul Studio. A document is loaded in the NET web browser. If you do not select this, you can open an index.html file in the directory of the document to browse the generated output document. The generated document example (Figure 27): Figure 27: The generated document output example can browse all your work through the navigation tree in the lower left corner. It should be said that the output of this document is quite complete. If it is more than the designs when designing, as the design is completed, a system's document has been generated, and there is a lot of strength of developers, it is the strongest function. And one of the most distinctive parts of Together. 6, TOGETHER's extension application 3: Import, export the XMI project file export XML project file. In the Model view, right-click the Video Store project, select the Export Project to Xmi command, pop up an XMI export dialog (Figure 28): Figure 28: Export items in XMI format You can set the type of XMI file And path. By default, ".. / out / xmi / video store.xmi". The situation is similar to some, and will not be described again.

7. TOGETHER settings Option Introduction General Options: Figure 29: General Option Delete Confirmation: This option definition When you need to confirm when you delete an element. Automatically Enable Together VS.NET Support for Opened Projects: TOGETHER is automatically enabled when an existing project is turned on. Automatically Enable Together vs.Net Support for the New Prjoects: Does TOGETHER automatically when new project files is created: Figure 30: Motto option font in diagrams: Settings in the chart view. Meber Format: Set the way the display is displayed. A UML method is the default representation method, and a Language is a natural language representation. Show Page Borders: Whether to display the border of the page. GIRD Height (Pixels): The height of the lattice, in pixels, the default value is 10 points. GID Width (Pixels): The width of the plaid, in pixels, the default value is 10 points. Show grid: Whether to display a lattice. Snap to Grid: Does the graphic adsorption of the format. 3D Look: Whether each graphic element is displayed in three dimensions. Document generation options: Figure 31: Document generation options bottom: Document bottom text. Documentation Title: Title of the document. Footer: Footnotes. Header: Head. Window Title: Window Title. INTERNAL: Whether to include internal values. Private: Whether to include a private value. Protected: Whether to include the protection value. Protected INTERNAL: Whether to include the private value of the protection. PUBLIC: Whether the public value is included. Genarate Help: Does it generate help. Genarate INDEX: Does an index are generated. Genarate Navbar: Does the navigation bar are generated. Genarater Tree: Whether a tree representation is generated. Genarate USE: Does a user use case. Model view options:

Figure 32: Model View Options Show Diagram Nodes Expandable: Whether the extended graphic element is displayed. Sorting Type: Sort Rules for Graphic Elements. Print Options: Figure 33: Print Options Print Compartments As Line: Whether to print the interval in line mode. Print Shadows: Whether to print a shadow. Footer Alignment: Footnotes Alignment. FOOTER TEXT: Footnotes print text. The default content is printed by% user% (% longdate%),% user% represents username,% longdate% represents a long date. Print Footer: Whether to print a footnote. Fit to Page: Whether it is suitable for the whole page. Font: Print the document with font. The default is 9.75 pounds of Microsoft Sans Serif fonts. Print Border: Whether to print the border. Print Empty Page: Whether to print a blank page. Print Zoom: The magnification is magnified when printing. HEADER: The text content per page is headed. Header Alignment: The document head text is used. Print Header: Whether to print a document head. Botoom Margin: The bottom of the document is blank. The default is 1 inches. Left margin: The left side of the document is blank. The default is 1 inches. TOP Margin: The top of the document is left blank. The default is 1 inches. Right Margin: The right side of the document is left blank. The default is 1 inches. Page Number Alignment: The page number is aligned. Print Page Numbers: Whether to print the page number. Custom Page Height: Custom page High. The default is 11.88 inches. Custom Page Width: Custom page width. The default is 8.4 inches. Paper Orientation: Print Direction. The default is Portrait. Page Size: The size of the page. The default is A4 paper. Source code option: Figure 34: Source code Option AutoCreate Association Links in Interfaces: Do you automatically create a relationship connection in an interface. AutoCreate Dependency Links: Do you automatically create a dependency connection. UML Options: Figure 35: UML Options Show Reference ClassNames: Whether the referenced class name is displayed. This option controls the display / hidden class name in the current project. View Management Options: Figure 36: View Management Options Show Association Links: Does a relationship connection. SHOW CLASSES: Whether the class is displayed. Show dependency links: Whether to display a dependency connection. Show generalization links: Whether to display an extensive connection. SHOW IMPLEMENTATION LINKS: Whether to display a connection. Show interfaces: Whether the interface is displayed. SHOW MEMBERS: Whether to display a member.

转载请注明原文地址:https://www.9cbs.com/read-113895.html

New Post(0)