As you can see, a package may contain other packages and some views : use case view, class view, component view and deployment view.
Ä㽫¿´µ½£¬Ò»¸ö°ü(package)¿ÉÄܰüº¬ÆäËû°üºÍһЩÊÓͼ£º ÓÃÀýÊÓͼ£¨use case view£©£¬ÀàÊÓͼ£¨class view£©£¬¹¹¼þÊÓͼ£¨component view£©ºÍ²¿ÊðÊÓͼ£¨deployment view£© ¡£
View, Use caseÊÓͼ£¨View,£© ÓÃÀý£¨Use case£©
Bouml uses views in a project to organize and structure the model elements and diagrams. The different types of views provide different context menus listing the diagrams and model elements that can be created in it.
BoumlÔÚÒ»¸öbouml¹¤³ÌÖÐʹÓÃÊÓͼÀ´×éÖ¯ºÍ½á¹¹»¯Ä£ÐÍÔªËØºÍͼ¡£²»Í¬ÀàÐÍÊÓͼÒÀ¾ÝÉÏÏÂÎÄÌṩ²»Í¬µÄ²Ëµ¥£¬ÒÔÁгöÔÚÆäÖпÉÒÔ´´½¨Í¼ºÍÄ£ÐÍÔªËØ¡£
To define use cases we need to have a use case view, so we choose new use case view : ÈôÒª¶¨ÒåÓÃÀý£¬ÎÒÃÇÐèÒªÓÐÒ»¸öÓÃÀýÊÓͼ(use case view) £¬ËùÒÔÎÒÃÇÑ¡ÔñеÄÓÃÀýÊÓͼ (new use case view)£º
Bouml asks for the name of the view, to change it later the use case view must be edited through a double mouse click, or choosing edit in the menu appearing on a right mouse click, showing the use case editor :
BoumlÒªÇóÌṩµÄÊÓͼÃû¡£ÔÚÒÔºóÒªÏëÐÞ¸ÄËü£¬±ØÐëÊó±êË«»÷ÓÃÀýÊÓͼ (new use case view)
£¬»òµãÊó±êÓÒ¼ü³öÏֲ˵¥£¬´Ó²Ëµ¥ÖÐÑ¡Ôñedit£¬ÔòÏÔʾÁËÓÃÀý±à¼Æ÷¡£
Diagramͼ
- 5 -
To create a use case diagram in this view, do a right click on the use case view and choose new use case diagram :
ÒªÔÚ´ËÊÓͼ´´½¨ÓÃÀýͼ(use case diagram) £¬ÔÚÓÃÀýÊÓͼÉÏÓÒ»÷Êó±ê£¬µ¯³ö²Ëµ¥£¬²¢Ñ¡ÔñеÄÓÃÀýͼ(new use case diagram) £º
The name is also asked, to change it the use case diagram must be edited choosing edit in the menu appearing on a right mouse click. Contrary to the non diagram items, a double click on a diagram show it :
ͬÑù»¹ÒªÊäÈëÓÃÀýͼµÄÃû×Ö¡£ÒªÐÞ¸ÄÓÃÀýͼ£¬ÔÚÓÃÀýͼÉÏÓÒ»÷Êó±ê¼ü£¬ÏÔʾһ²Ëµ¥[´Ë²Ëµ¥ÎªÔªËصĹØÁª²Ëµ¥£¬ÒÔºó¼ò³Æ¹ØÁª²Ëµ¥]£¬´Ó²Ëµ¥ÖÐÑ¡Ôñedit¡£Ïà¶ÔÓÚ·ÇͼÏÔÚͼÉÏË«»÷ÏÔʾ¡£
- 6 -
Add elements in a diagramÔÚͼÖÐÌí¼ÓÔªËØ
To create and place a use case in the use case diagram you have two ways : ÔÚÓÃÀýͼÖд´½¨²¢·ÅÖÃÓÃÀýÄãÓÐÁ½ÖÖ·½·¨¿ÉÑ¡ £º
to do a right click on the use case view and to choose new use case, then to drag it from the browser to the diagram,
? ÔÚÓÃÀýÊÓͼÓÒ»÷Êó±ê,Ôڲ˵¥ÖÐÑ¡ÔñеÄÓÃÀý(new use case) £¬È»ºó´Óä¯ÀÀÆ÷ÍϷŵ½Í¼ÖС£
or to hit the ellipsis button in the top of the diagram sub-windows, then to hit somewhere in the diagram sub-window.
? »òµã»÷ͼ×Ó´°¿Ú¶¥ÉϵÄÓÃÀý¹¦ÄÜ£¨ÍÖÔ²£©°´Å¥£¬È»ºóÔÚͼÖÐij¸öµãµã»÷Êó±ê¼´¿É¡£ Note that the use case is created in the view containing the diagram, this will be the same thing in the others case whatever the diagram except for the states machine.
Çë×¢Ò⣬ ÓÃÀýÊǰüº¬ÓÃÀýͼµÄÊÓͼÖд´½¨µÄ£¬³ý״̬»ú£¨states machine.£©Í⣬²»ÂÛºÎÖÖͼ½ÔÓë´ËÀàËÆ¡£
Let's Withdraw the name of the use case. ÎÒÃǽ«ÓÃÀýµÄÃû×ÖȡΪ Withdraw¡£ To move the use case in the diagram, do a left click on it and move the mouse click down, the name follow the use case but the name may be moved independently, for instance to place it in the middle of the ellipsis. You may also select the use case and to use the arrows of the keyboard. ÒªÒÆ¶¯Í¼ÖеÄuse case £¬ÔÚuse caseÉϰ´Êó±ê×ó¼ü£¬±£³Ö°´ÏÂ×´Ì¬ÒÆ¶¯Êó±ê£¬ÓÃÀýÃû¸ú×ÅÓÃÀýÒÆ¶¯ £¬µ«ÓÃÀýÃûÒ²¿ÉÒÔ¶ÀÁ¢Òƶ¯¡£ÀýÈ磬½«ÓÃÀýÃû·ÅÖÃÔÚÍÖÔ²µÄÖм䡣ÄúÒ²¿ÉÒÔÑ¡ÖÐÓÃÀýºóʹÓüüÅÌÉϵļýÍ·ÒÆ¶¯¡£
Create an actor named Customer like you create the use case, to have : ´´½¨Ò»¸öÃûΪCustomerµÄ½ÇÉ«ÈçͬÄã´´½¨ÓÃÀýÒ»Ñù£¬½á¹ûÈçÏ£º
- 7 -
Note that an actor is in fact a class, when the stereotype is actor the icon shown in the browser is an actor, else a class. To change the stereotype edit the class (double mouse click on the class, or choosing edit in the menu appearing on a right mouse click on the class), choose among the predefined list of stereotypes or enter a new one, read the reference manual to change the predefined list of stereotypes.
Çë×¢Ò⣬һ¸ö½ÇÉ«(actor)ÆäʵÊÇÒ»¸öÀà £¬µ±°åÐÍÊǽÇɫʱ£¬ÔÚä¯ÀÀÆ÷ÖÐÏÔʾµÄͼ±êÊÇÒ»¸ö½ÇÉ«£¬·ñÔòÊÇÒ»¸öÀà¡£Òª¸Ä±ä°åÐÍ£¬±à¼ÀࣨÔÚÀàÉÏË«»÷Êó±ê£¬»òÔÚÀàÉϵã»÷Êó±êÓÒ¼ü³öÏֵIJ˵¥£¬Ñ¡Ôñedit£©£¬´ÓÔ¤¶¨ÒåÁбíÖÐÑ¡Ôñ°åÐÍ»òÊäÈëÒ»¸öеİåÐÍ¡£¹ØÓÚÐÞ¸ÄÔ¤¶¨ÒåµÄ°åÐÍÁÐ±í£¬ÇëÔĶÁ²Î¿¼Êֲᡣ
The use case picture may be resized moving the points appearing when you click on the use case. The actor can't be resized.
ÓÃÀý¿ÉÒԸıä´óС£ºµã»÷ÓÃÀý£¬Òƶ¯µÄ³öÏֵ㼴¿É¡£È»¶ø½ÇÉ«²»Äܵ÷Õû´óС
You have to ways to draw the association : a simple line as UML recommendation, or an arrow. Hit on the desired icon, left click on the actor, move the mouse click down up to the use case and release the click :
ÄãÓжàÖÖ·½·¨»³ö¹ØÁª¹ØÏµ£ºUMLµÄÍÆ¼ö£¨Ò»Ìõ¼òµ¥ÏßÌõ»òÓмýÍ·£©£¬µã»÷ËùÐèͼ±ê°´Å¥£¬ÔÚ½ÇÉ«Éϵã»÷£¨²»ËÉ¿ª£©£¬Òƶ¯Êó±êµ½ÓÃÀýÉÏ£¬ËÉ¿ªÊó±ê¡£
The lines may be broken during the initial construction if you release the click out of any item, or after the construction with a left mouse click on the line and moving the mouse click down.
ÔÚ×î³õµÄ¹¹½¨ÏßÌõʱ£¬Èç¹ûÄãÔÚÔªËØÖ®ÍâËÉ¿ªÊó±ê×ó¼ü£¬ÏßÌõ±ä³ÉÕÛÏß¡£»òÔÚÏßÌõ¹¹½¨Íê³ÉÖ®ºó£¬ÔÚÏßÉϵã»÷Êó±ê×ó¼ü£¬Í϶¯ÔÏßÌõÒà±äΪÕÛÏß¡£
To remove a point in a line, double left click on it, or right click to show the menu and choose
- 8 -