Visualizing Composition in Design Patterns

Visualization of design patterns information play a vital role in analysis, design and comprehension of software applications. Different representations of design patterns have been proposed in literature, but each representation has its strengths and limitations. State of the art design pattern visualization approaches are unable to capture all the aspects of design pattern visualization which is important for the comprehension of any software application e.g., the role that a class, attribute and operation play in a design pattern. Additionally, there exist multiple instances of a design pattern and different types of overlapping in the design of different systems. Visualization of overlapping and composition in design patterns is important for forward and reverse engineering domains. The focus of this paper is to analyze the characteristics, strengths and limitations of key design pattern representations used for visualization and propose a hybrid approach which incorporates best features of existing approaches while suppressing their limitations. The approach extends features which are important for visualizing different types of overlapping in design patterns. Stereotypes, tagged values, semantics and constraints are defined to represent the design pattern information related to attributes and/or operations of a class. A prototyping tool named VisCDP is developed to demonstrate and evaluate our proposed. Keywords—Design patterns; Visualization; Program Comprehension; Reverse engineering; Composition


INTRODUCTION
Design patterns are proven solutions and they are composed with each other for the development of software applications [1,2,3].The composition of design patterns [4,5] when applied in an effective manner solves many generic and specific problems related to any object oriented programming domain.The visualization of pattern related information in UML diagrams and visualization of overlapping in recognized design patterns plays an important role for the program comprehension during forward as well as reverse engineering.The importance of composite visualization of design patterns is also highlighted by authors [32,33,34].Mostly, design patterns are modeled using visual and formal languages such as UML [6], DPML [23], LePUS [26], RSL [31] etc. UML is a semiformal type of modeling language which is widely accepted by the academia and industry.It has a collection of visual notation techniques to build, specify, visualize, modify and document the visual models of software systems.
It is realized by Dong et al. [7] that standard UML is unable to keep track of the roles each modeling element plays in a design pattern and other design pattern related information.Therefore, some authors presented extended UML based design pattern specification and visualization approaches [3,9,13,27,28,30].The alternate visual and/or textual notations are also proposed to visualize the pattern related information in the software design.Porras et al. [8] concluded that all existing approaches are not capable to include all design pattern related information that is important for the comprehension of a software design.Therefore, it is important to carefully investigate all the notations.Authors in [8] presented a framework to compare the current and future notations based on participation, role and compositions of artifacts which play key roles in designing and composition of design patterns.They realized that different notations have their strengths and limitations.The limitations of existing notations provide opportunities to researchers for devise new notations that would further overcome identified limitations while combining the best features of current notations.We critically analyze state of the art design pattern representation approaches in the literature review Section 2.
The selection of an appropriate notation is important for designers, maintainers and reverse engineers.We selected Pattern: Role notation [3] and stereotype enhanced UML diagrams presented by Dong et al. [9] as baselines to propose our hybrid approach.These two notations are most representative and they are also used by other researchers [8].Pattern: Role Notation is highly readable and informative, but it cannot represent the roles that an operation and attribute plays in a design pattern.This notation also cannot distinguish the multiple instances of the same design pattern.Stereotype enhanced UML diagrams are defined mainly by presenting a new UML profile for the representation and the visualization of the design patterns in their composed form.This approach represents the role each modeling element plays in a design pattern, but it is strongly textual thus text overload can considerably increase the size of the classes as well as make the classes harder to read.Furthermore, both these approaches do not focus on the visualization of different types of overlapping in design patterns which are important for the comprehension of software applications.When different roles (patterns, classes, operations, attributes) of a design pattern are reused in other patterns in the same application design, we call these roles overlapping.Such overlapping are very common in software applications as discussed by [4,15,16,24,25].While analyzing results of different design pattern recovery tools, we recognized that proven composite patterns are present with different overlapping.For example, the Java AWT framework is composed of different patterns.Similarly, we found overlapping in different roles of Abstract Factory pattern and visitor pattern as mentioned in well know book by Gamma et al. [35].Overlapping in design patterns give information about the level of coupling in different patterns and their roles.The detection and visualization of overlapped pattern roles are important for maintenance, comprehension and change impact analysis.www.ijacsa.thesai.org In order to overcome the limitations of design pattern visualization techniques [3,9], this paper is intended to propose an approach that integrates the best features of Pattern: Role notation [3] and stereotype enhanced UML diagrams [9] while surpassing their limitations.Our approach extends new features for highlighting different types of overlapping and it is equally beneficial for forward and reverse engineering activities.The presented approach helps to visualize the following pattern related information in the recognized design patterns as contribution of this work:  To visualize the role that a class, attribute and operation play in a design pattern;  To visualize the multiple instances of a design pattern in class diagrams;  To visualize One to one, one to many and many to many overlapping in design patterns;  A proposed hybrid approach supplemented with prototyping tool VisCDP to support above mentioned claims;  Evaluation and comparison of approach on a case study.
The rest of paper is structured as follows: We discuss state of the art on design patterns visualization approaches in Section II.Section III presents the comparison of existing approaches based on different attributes.A proposed hybrid approach used for visualization of composition in design patterns is laid down in Section IV.The prototyping tool used to validate concept of the proposed approach is discussed in Section V. Section VI discusses evaluation of approach with the help of a case study.Finally, we conclude and sketch future directions in Section VII.

II. RELATED WORK
Design patterns are widely used in open source and industrial applications as they are known solutions to recurring problems [10].Generally, the software developers come across with the certain kinds of problems repeatedly in their daily routines.They evaluate such problems and their context by referring to some existing design patterns and select a particular design pattern based on their needs and requirements.The reuse of a design pattern helps the software architect to reuse the knowledge that has already been documented and tested in order to improve the quality of their products.The visualization of design patterns information in large and complex software systems is decisive for the comprehension of software applications [21].The better visualization of design patterns information enables better comprehension of examined applications [29].Different authors proposed different approaches for the visualization of design patterns in software designs which are discussed as follows: Smith [11] proposed a hierarchical approach called Pattern Instance Notation (PIN) to visually represent the composition of patterns.This notation provides a simple visualization approach which is not only for design patterns, but it is also for other abstractions of software engineering.A suitable graphical notation based on boxes and lines is devised in this approach, defining three modes namely collapsed, standard and expanded.The boxes are simple round corner rectangles having a pattern name in the center.Each box represents a specific design pattern instance.The pattern instances are connected to the different elements of a class through unidirectional arrows.PIN kept things simple and focus on the multiple design pattern instances and their roles.The proposed approach is still at infancy stages and work is in progress as mentioned by the author.Dong et al. [9] presented a new UML profile for the representation and the visualization of the design patterns in their composed form.Few new stereotypes, their corresponding tagged values and constraints are defined in this extended UML notation to explicitly visualize pattern related information in any software design.UML meta-model is used to define such extension in UML profile.This new UML profile represents the role each modeling element (class, attribute, operation) plays in a design pattern.This approach also distinguishes the multiple instances of a design pattern.In addition, authors developed a tool called VisDP [12] for the dynamic visualization of design patterns information.Such information is displayed dynamically when the user moves the cursor on the screen.The applied approach is only limited to the visualization of design patterns information for forward engineering.Furthermore, authors did not focus on the visualization of different types of overlapping in the presented methodology.
Dong [13] proposed another new graphical notation that is an extension to UML.This approach provides a mechanism to visualize each individual pattern in the composition of design patterns by adding the tagged values.These tagged values contain the pattern and/or instance(s) and/or participant name(s) associated with the given class and its operations and attributes.The format of a tag is -pattern [instance]: role‖ = True/False.For example, if a class is tagged with notation -Adapter [1]: Adaptee‖ then the class plays a role of Adaptee in the first instance of the Adapter pattern.For the sake of simplicity only the participant name can be shown as it does not create any ambiguity.The author himself determined its limitation as the pattern related information is not as noticeable as the -pattern: role‖ notation with shading, but he consider it as a tradeoff.This approach provides a mechanism to determine one to one overlapping, but it does not focus on the other two types of overlapping.
Vlissides et al. [3] proposed a notation to explicitly visualize the pattern related information.In this notation, each class is tagged with a gray shaded box containing the pattern related information in the form of -pattern: role‖.Each box, associated with a class, contains the pattern name and the role name that this class plays in the associated design pattern.If a class participates in more than one design pattern then all the design patterns in which this class participates will be presented in the same box.For the sake of simplicity, if the class role name is the same as of the design pattern then the design pattern name can be omitted.This notation is more scalable, highly readable and informative.However, the size of the original diagram can significantly be increased as each class has an associated gray box with it.This notation also does not represent the role that an attribute and operation play in a www.ijacsa.thesai.orgdesign pattern.There occur multiple instances of a design pattern in a class diagram, but this approach cannot distinguish the multiple instances of a design pattern.Moreover, Dong et al [9] identified the problems related to scanning and reading on the printed media because of gray backgrounds.Schauer et al. [14] developed a prototype to make the program comprehension simple and efficient by recognizing design patterns and their visualization.For the visualization of design patterns, they proposed pattern enhanced class diagrams that use different colored borders to identify different patterns.This approach provides ease for identifying all the classes participating in a design pattern as this approach is strongly visual.However, this approach cannot identify the role a class, attribute and operation plays in a given design pattern.Moreover, it is really difficult to identify all the design patterns in which a class participates.Authors argue that they enhanced UML representation, but statistically it is difficult to measure improvement in the presented approach.The examples selected for experiments are very small and generalization of approach for large and complex systems is questionable.
Vlissides [3] presented an alternative notation that addresses the limitations of Venn diagram notation.In this notation, dashed ellipses are used to represent the design pattern names.Each ellipse (design pattern) is connected with its participating classes through dashed lines.These dashed lines contain the role names each class plays in a specific design pattern.This approach gives a major breakthrough over Venn diagram notation by specifying the role each class plays in a design pattern.However, the role that attribute or operation plays in a design pattern is not covered in this approach.In addition to this, the scalability issue arises as the system size grows.The design pattern information and the class structure get intermingled and the cluttered lines make it really hard to read and identify the required information [9 13].
Vlissides [3] introduced another intuitive approach to explicitly visualize the design patterns participating in a design diagram in the same report.To distinguish the design patterns from each other, all the classes participating in a design pattern are bounded with different shades of colors.Hence, all the classes participating in a design pattern are easily identified.This approach works well for small number of patterns in the system, but the scalability issue arises when the system size grows.It becomes very difficult to differentiate the overlapping among different design patterns when different classes participate in multiple design patterns.Moreover, this notation does not clearly depict role of different artifacts in the corresponding design patterns.The major focus of authors is to identify the boundary of each design pattern [9,13].
The concept of composition of design patterns using formal specification is presented by Bayley et al. [4].Authors applied idea of composition of patterns based on lifting and specialization operations on patterns.The meta-modeling notation GEBNF [16] is used for specification of composition in the design patterns.The applied approach has key focus on composition and formal verification of patterns which can be used for detection of design patterns, but it has no link with the visualization of design patterns during forward and reverse engineering phases which is a major focus of our approach.Composition of patterns is explained using Composite, Strategy and Observer design patterns.
Marie et al. [20] presented a design pattern visualization approach based on different pattern matching views.They used class view, pattern view and Abstract syntax view to represent and visualize information related with design patterns.User can compare candidate patterns with the specification.The experiments are performed on an Observer design pattern using JHotdraw [22] and generalization of composition with other patterns need investigation.The approach did not focus on visualization of operations and different types of overlapping in recognized design patterns.The approach is also limited to visualization for reverse engineering purpose.

III. COMPARISION OF EXISTING APPROACHES
UML and non-UML based notations are presented by different researchers for the specification and visualization of information related with design patterns.Non-UML based notations provide option of reasoning, verification and tool support, but they lack support for integration with other tools.These notations also have limitations to specify all features of design patterns.For example, LePUS is not cable to specify all GoF design patterns and their variants [26].Standard UML based notations are also not capable to model all properties of design patterns, but still they are widely used due to integration of UML tools with other tools.While comparing different notations in this paper, we focus on UML based notations.
An empirical study conducted by Porras et al. [8] concluded that none of the existing notations fits all possible tasks.Therefore, it is important to carefully investigate all the notations.Authors suggested a framework to compare the current and future notations.The findings of study reflect that different notations have their strengths and limitations thus providing a ground to devise new notations that would further overcome identified limitations while combining the best of current notations.We compare the features of existing notations that are presented by different authors [3,9,11,13,14,20] on the basis of attributes suggested by the existing framework [8] and by adding new attributes as indicated in Table 1.The major focus in our evaluation is visualizing different types of overlapping in the design of software systems.
Venn diagram-style pattern annotation and Pattern Enhanced Class Diagram are strongly visual approaches, but they do not specify the role each modeling element plays in a design pattern.They are just used to identify the boundary of a design pattern.UML Collaboration Notation is both visual and textual approach representing the role a class plays in a design pattern.However, the role that an attribute or operation plays in a design pattern is not covered in this approach.In addition to this, the scalability issue arises as the system size grows.The design pattern information and the class structure get intermingled and the cluttered lines make its comprehension really hard.Pattern: Role Notation also does not represent the role that an attribute and operation play in a design pattern.This approach is not able to distinguish the multiple instances of a design pattern.www.ijacsa.thesai.orgTagged Pattern Annotation, Tagged Pattern Annotation with shading, Tagged Pattern Annotation with bounding, Tagged Pattern Annotation with new compartments and Stereotype enhanced UML diagrams represent the role each modeling element plays in a design pattern, but the notations make the information really hard to read.Pattern Instance Notation represents the roles each modeling element plays in a design pattern and focus on the multiple design pattern instances, but this approach is still in progress.Furthermore, all these notations do not focus on the visualization of different types of overlapping in design patterns.We present an extended evaluation framework which compare features of all existing notations as given in Table 1.
There are no standard metrics to measure and compare features of different notations such as comprehension, complexity and flexibility.We deeply analyzed features of existing notations and defined our self-scales to measure these features for the purpose of visualization.For example, we defined three scales for measuring the comprehension.These scales are easy, moderate and hard.The easy scale means that comprehension of a notation is user friendly and it is not complex to understand.The moderate scale means that comprehension is between easy and hard scales.The hard scale means that comprehension of a notation is difficult.Similarly, other features are also measured based on our self-scales.The major challenge for visualization approaches is generalization of scalability feature for the visualization of design patterns information.The existing approaches ensure scalability for small and medium size of software packages, but the scalability for large software applications is challenging.It is visible from features of the state of the art design pattern visualization notations in Table1that there is no notation that can visualize all types of overlapping.The comprehension of different notations varies when the size of an application increases.In order to overcome the limitations of above mentioned design pattern visualization techniques, this paper is intended to propose an approach that integrates the best features of Pattern: Role notation [3] and stereotype enhanced UML diagrams [9] while overcoming their limitations.The proposed approach also appends new functionality regarding visualization of different types of www.ijacsa.thesai.orgoverlapping in UML class diagrams which is important for the comprehension of software applications.

IV. PROPOSED HYBRID APPROACH
It is apparent from discussion in Sections 2 and 3 that the current design pattern visualization approaches are unable to capture all the aspects of design pattern visualization which is important for the comprehension of any software application e.g., the role that a class, attribute and operation play in a design pattern.Similarly, there exist multiple instances of a design pattern and different types of overlapping among different classes.The key motivation for this approach is to represent and visualize the pattern related information in the composition of design patterns.Our hybrid notation is elaborated in the following three subsections.

A. Building on Pattern:Role Notation
Our proposed notation is given below: Where Pattern represents the design pattern name in which a class participates.Pinstance represents the instance of a specific design pattern as there can be multiple instances of a design pattern in the software design.Role represents the role name a class plays in the associated design pattern.Rinstance represents the multiple instances of a class role.We will use this field to visualize different types of overlapping among different classes.A note box containing design pattern information is attached to each class.For the sake of simplicity, if there is only one instance of a design pattern then Pinstance can be omitted.Similarly if there are not multiple instances of a class role then Rinstance can be omitted for ease.For example, file class plays the role of leaf in composite design pattern as shown in Fig. 1.As there is only one instance of leaf therefore Rinstance can be omitted.Also if the design pattern and the class role names are same then the class role can be omitted.For example, directory class plays the role of composite in the Composite design pattern and there is only single instance of the composite design pattern.Thus for the sake of simplicity, the role and the Pinstance fields are omitted as shown in Fig. 1.
The following example further explains how our notation represents information when a single class plays more than one role in different design patterns: Adapter [1]:Adaptee [1] Strategy [2]: Context [1] Bridge [1]:Implementor [1] Suppose above notational information is attached to a Class A. The notations reflect that Class A plays the role of Adaptee in the first instance of an Adapter design pattern.The same Class A plays the role of Context in the second instance of Strategy design pattern and a role of Implementor in the first instance of Bridge design pattern.The ‗1' on the right hand side of above notations state that Class A is overlapped in three design patterns with different roles.

B. Incorporating UML Profile for Design Patterns Visualization
Stereotypes are used to extend UML profile by defining tagged values and constraints.These tagged values and constraints corresponding to a stereotype get attached to modeling element to which that stereotype is branded [17].Two stereotypes <<Pat>> for Pattern attribute and <<Pop>> for Pattern operation are defined to explicitly visualize the role that an attribute and operation performs in a design pattern.Each element is associated with its respective stereotype e.g., stereotype <<Pat>> is associated to all such attributes of a class that plays a specific role in a design pattern.Similarly, <<Pop>> stereotype is associated with all operations of a class that are the participants of a design pattern.The tagged values corresponding to these stereotypes are defined in Table 2.The semantics and constraints on applied stereotypes are discussed below:

1) Semantics
The detailed semantics of the stereotypes and their corresponding tagged values are given in Table 2. <<Pat>> and <<Pop>> stereotypes are defined to be associated with the attributes and operations of a class that play specific roles in a design pattern respectively.Each stereotype is applied on the corresponding modeling element and the role of that element is identified by the tagged value.The format of the tagged value is Pattern [Pinstance]: Role, Pattern specifies the design pattern name in which this attribute or operation participates, Pinstance specifies the number of design patterns instance to which this attribute or operation belongs to, Role specifies the certain role name that this attribute or operation plays in the design pattern.For example, in Fig. 1, getName () operation of class Node plays the role of Request in Proxy design pattern.There is only one instance of Proxy in the given system.Therefore, the stereotype <<Pop {Proxy [1]: Request}>> is branded to the getName () operation of class Node.It may be possible that an attribute or operation play different roles in different design patterns.www.ijacsa.thesai.org

2) Constraints
We discuss in detail the constraints that are imposed on the stereotypes used by our approach.
As stereotypes are associated with modeling elements (attribute and/or operation), constraints also get associated with them.These constraints compel certain kinds of restrictions on the modeling elements.We used Object Constraint Language OCL [18] to write these constraints formally.To define constraints for <<Pat>> and <<Pop>>, we will use standard properties of OCL such as self.a,where a can be a reference or any base class.The constraints for the stereotypes <<Pat>> and <<Pop>> are defined as follows:

C. Visualization of Composition
Design patterns are mostly used in a composed form and multiple types of overlapping occur among different instances of design patterns.Visualization of the overlapping in recognized design patterns play an important role for the program comprehension during forward as well as reverse engineering.When the design patterns are composed with each other, there may occur three types of overlapping namely one to one, one to many and many to many overlapping.State of the art design patterns visualization approaches did not pay attention to detect and visualize overlapping.In this paper, our focus is on visualizing all three types of overlapping for forward as well as reverse engineering purposes.We want to clarify that our approach takes extracted result of design pattern recovery tools and then visualize information related with design patterns.One to one overlapping: If there is only one leaf class in the Composite pattern and the composite pattern is composed with the Adapter pattern in such a way that this leaf class is adapted by the adapter then that is a one-to-one overlap.In this case, the same class plays two different roles in two different design patterns.One to many overlapping: If there are multiple leaves of Composite pattern and the Composite and Adapter patterns are composed with each other in such a way that two or more leaves of the Composite pattern are adapted by the same Adapter pattern then this is called oneto-many overlapping.Finally, many to many overlapping: this type of overlapping occurs among patterns when more than one role in a pattern are reused more than one time in another pattern.Zhu et al. [19] presented the composition of Composite and Adapter design patterns with many to many overlapping.In this composition, there are multiple instances of component leaf of Composite design pattern.There are some instances of Leaf class that are adapted by multiple instances of target of Adapter design pattern.Hence, there are multiple targets for multiple leaves.This is an example of many (Targets) to many (Leaves) overlapping.
Figs. 2, 3 and 4 give a view of visualization of one to one, one to many and many to many types of overlapping using our hybrid approach.www.ijacsa.thesai.orgPROTOTYPING TOOL A prototype tool, VisCDP is developed for the realization of proposed approach.VisCDP is used to visualize design pattern information related to classes, operations and/or attributes in the composition of recognized design patterns.It provides static as well as on demand (dynamic) visualization in UML class diagrams.On demand option is used for filtration and highlighting information about roles participating in different design patterns.For example, by moving the cursor in a class, operation/attribute name, a box with highlighted design pattern information is displayed.These highlighted boxes improve the visibility and comprehension of information.VisCDP supports filtration option on both class and design pattern names and the user can view any specific class and/or design pattern information in a tabular form.
class one to one ov erlapping example

Checkbox Choice
Composite [1]:Component [1] Composite [1]:Leaf [1] Composite [1]:Leaf [2] Composite [1]:Leaf [3] Composite [1]:Composite [1] Adapter [1]:Adaptee [1] Adapter [1]:Target [1] Adapter [1]:Adapter  VisDP is also capable to display design pattern information in a tabular form which is important to know the impact of each class in different design patterns as shown in Fig. 6.The first column in Fig. 6 shows name of a class and the second column show name of design pattern in which a particular class exists.The third column shows the number of design pattern's instance in which a class exists.The last column in Fig. 6 shows that how many roles a particular class is playing in different design patterns.

VI. EVALUATION OF APPROACH
The presented approach is evaluated on a JHotDraw-5.1softwarepackage which is implemented using different design patterns.This version of JHotDraw-5.1 [22] contains 136 classes and total lines of source code are 30860.We partially selected a set of nine classes from this software package to demonstrate our approach as proof of concept.We also implemented other two approaches [3,9]  The objective of selecting this software package is to evaluate our hybrid approach and to compare the results with the other two approaches [3,9].Although, we compare eleven different pattern representation approaches in Table 1, but we selected these two approaches for evaluation and comparison with our approach as these are most representative approaches.
Pattern: Role notation (Gamma's Approach) does not represent the role that an attribute and operation play in a design pattern.Multiple instances of a design pattern may exist in a class diagram, but this approach cannot distinguish the multiple instances of a design pattern.Fig. 7 represents the resulting diagram after implementing the Gamma's approach on our case study.
Stereotype enhanced UML diagrams (Dong's Approach) represent the roles that a class, operation and attribute plays in a design pattern.This approach also distinguishes the multiple instances of a design pattern, but the text overload considerably increases the size of the classes and consequently it becomes really hard to read a design pattern related instances of a design pattern, but the text overload considerably increases the size of the classes and consequently it becomes really hard to read a design pattern related information.in different types of overlapping.Fig. 8 presents the resulting diagram after implementing the Dong's approach on our case study.www.ijacsa.thesai.orgTable 3 presents the comparison of Gamma, Dong and our hybrid approach based on the key features used by visualization approaches.One of the major characteristics of our hybrid notation is to represent the multiple instances of a class role that a class plays in different design patterns.This feature exactly determines different types of overlapping i.e. one to one, one to many and many to many which differentiate our approach from state of the art approaches.Our proposed approach has visualization support for forward as well as for reverse engineering cycles as compared with approaches of Gamma and Dong.We support all types of overlapping which are important for comprehension of visualization for different instances of design patterns in any software.
Similarly, our approach uses combination of visual and textual aspects of design patterns information for better visualization as compared to previous approaches.Finally, our approach achieved the comprehension at moderate level.We validated comprehension of our approach through a questionnaire.We sent a questionnaire to 20 master students that were studying a course on software visualization at COMSATS Institute of Information Technology.We sent three samples of visualization styles for our approach and other two approaches [3,9] as a part of the questionnaire.85% of the students rated comprehension feature of our approach moderate.
Validity is the major concern for researchers and practitioners to validate the results of information retrieval techniques.Regarding construct validity, one of the major threats to the results of our approach is related to design patterns identification from source code and analysis of dependencies as there is a lack of standard definitions for design patterns.The structural and implementation variations are key factors which impact the accuracy of design pattern detection tools.We reduced this threat as we used results of patterns which are already verified.To ensure internal validity, we used JHotDraw-5.1 as a case study.JHotDraw-5.1 is a drawing editor and it is developed by using different design patterns.The source code is available freely for validation of results.However, threats to external validity are related to what extent we can generalize our results.Thus in case of large scale systems, our results for class view may be a threat to the external validity of our visualized results.Regarding reliability validity, we used JHotDraw-5.1 which is open source software and is publically available.

VII. CONCLUSION AND FUTURE WORK
The comprehension of large and complex systems based on design patterns is a challenging problem.Different representations of design patterns have been proposed, but each representation has its strengths and limitations.Current design pattern visualization approaches are unable to capture all the aspects of design patterns visualization which is important for the comprehension of any software application e.g., the role that a class, attribute and operation plays in a design pattern.Similarly, there exist multiple instances of a design pattern and different types of overlapping among different classes.
With the critical analysis of state of the art design pattern visualization approaches, we propose an approach that integrates the best features of Pattern: Role notation [3], stereotype enhanced UML diagrams [9] and appends new features to visualize the design patterns in class diagrams.The proposed hybrid notation is used to represent design pattern information related to roles and to visualize different types of overlapping.Stereotypes, their associated tagged values, semantics and constraints are defined to represent the design patterns information related to attributes and/or operations of a class.We used a subset of open source software JHotDraw-5.1 to evaluate our approach and compared the results with the other approaches.The proposed approach improves the visualization of design patterns as compared with previous approaches [3 9].A prototyping tool named VisCDP is implemented to support our research work and to validate the concept of our hybrid approach.VisCDP is used to visualize design pattern information related to classes, operations and/or attributes in the composition of recognized design patterns.It provides static as well as on demand (dynamic) visualization in class diagrams.It is worthwhile to mention that our current approach is limited only to the visualization of design pattern information in class diagrams and we do not focus on visualization of information in sequence, collaboration and other types of diagrams.We evaluated our approach on a subset of the small scale case study (i.e., JHotDraw-5.1) and scalability of approach for large scale systems is questionable which will be investigated in future.The approach is also limited to visualize the standard representations of GoF patterns and we do not consider variants of same design patterns.In future, we plan to evaluate the scalability of our hybrid approach on large and complex systems.

Fig. 5 .
Fig. 5. Architecture of VisCDPThe user enters the class and associated design pattern information manually into the tool and then he/she can visualize the output in pictorial and tabular view according tohis/her requirements.Fig.5presents the architectural overview of VisCDP.The Visual Studio.NET is used to create the Web forms.The presentation layer for VisCDP is VB.NET

Fig. 6 .
Fig. 6.Design Patterns Information in Tabular Form (Class Wise) using same software package.The partial software package design is composed of five design patterns: two instances of Adapter and a single instance of Strategy, Composite and Bridge design patterns.Figure class, playing three roles in three different design patterns, is a central abstraction of the drawing editor framework.It represents a graphical figure that users can work with.

Fig. 7 .
Fig. 7. Gamma's Approach Implemented on JHotDraw-5.1 The proposed approach representing design pattern information on a subset of JHotDraw-5.1 classes is shown in Fig. 9.The notation -Bridge [1]: ConcreteImplementor[1]‖ attached to class Drawing represents that Drawing class plays the role of ConcreteImplementor in the Bridge.-Bridge [1]:ConcreteImplementor[2]‖ attached to class TextFigure represents that TextFigure class is the second instance of ConcreteImplementor in the same instance of design pattern Bridge.

TABLE . I
. COMPARISON OF DESIGN PATTERN REPRESENTATION APPROACHES BASED ON DIFFERENT VISUALIZATION ATTRIBUTES

TABLE .
III. COMPARISON OF GAMMA, DONG AND OUR HYBRID APPROACH BASED KEY FEATURES