Wednesday, June 30, 2010

How to Draw a CCD from Code

How to Draw a CCD from CodeHow to Draw a CD from Code Suppose you want to understand a new component. What other components do you need to understand first? The main purpose of a component coupling diagram (CD) is to show you exactly this information. How do you start from the code to be understood, such as that in Figure 2, and produce a CD, such as that of Figure 1, which concisely summarizes the intercomponent dependencies of interest? The purpose of this document is

to demonstrate that proces, which could be automated by a tool. Many tools of this sort are available to draw UML clas diagrams, for example—another notation for depicting dependency information. There are six steps involved in drawing a CD from Resolve/C+ code, of which only the highlighted portion is relevant from the standpoint of a CD. These steps are ilustrated below in piece-by-piece construction of the example CD of Figure 1, which shows al the dependencies to al the components that you need to understand in order to understand Queue_Sort_1. Figure 1: CD showing dependencies from Queue_Sort_1 / /*--------------------------------* / | Concrete Template : Queue_Sort_1 / *--------------------------------*/ #ifndef CT_QUEUE_SORT_1 #define CT_QUEUE_SORT_1 1 //----------------------------------- // Global Context --------------------------- //----------------------------------- #include "AT/Queue/Sort.h" /*! #include "AT/General/Are_In_Order.h" #include "AT/Queue/Kernel.h" Queue_ Sort_1 e i i Queue_ Kernel e Queue_ Sort i General_Are _In_Order u 2 HOW TO DRAW A CD FROM CODE !*/ //----------------------------------- // Interface ----------------------------- //----------------------------------- concrete_template < concrete_instance clas Item, concrete_instance utility_clas Item_Are_In_Order, /*! implements abstract_instance General_Are_In_Order !*/ concrete_instance clas Queue_Base /*! implements abstract_instance Queue_Kernel !*/ > clas Queue_Sort_1 : implements abstract_instance Queue_Sort , extends concrete_instance Queue_Base { private: local_procedure_body Remove_Min ( alters Queue_Sort_1& q, produces Item& min ) /*!...

Website: www.cse.ohio-state.edu | Filesize: 189kb
No of Page(s): 10
Download How to Draw a CCD from Code.pdf

No comments:

Post a Comment