Title of Invention

METHOD AND SYSTEM FOR ENABLING REPRESENTATION OF UML CLASS DIAGRAM IN A LISP FORMAT AND DESIGN PATTERN

Abstract Method and a system for enabling representation of UML Class diagram in Lisp format and design pattern detection using such representation. A method for enabling representation of UML Class diagram in a Lisp format and for design pattern detection in UML Class diagram comprising the steps of parsing XMI file describing a UML class diagram in XML framework; storing metadata described in the XMI file into a platform-independent format; converting such metadata into Lisp representation; developing Lisp rules to detect design patterns; firing the said design pattern detection rules on the Lisp representation of UM1, class diagram; and identifying the design pattern.
Full Text

This invention relates to a method and system for enabling representation of UML Class diagram in a Lisp format and for design pattern detection using such representation.
In other words, this invention relates to a method of representing UML Class diagrams in Lisp format, that is to say, in a manner which can be recognised by a Lisp interpreter. This invention also relates to a method of design pattern detection from UML Class diagrams.
An object of the present invention is to define a format for representing UML class diagrams such that it can be recognized by Lisp interpreter, and design pattern detection rules (written in Lisp) can be applied on this format.

There are many advantage's in detecting design patterns at design time itself. For instance:
• Design patterns provide higher level abstraction of
program structure than classes.
• Design patterns provide easier understanding of software
structure.
• Design patterns help in better documentation of software
system.
The method, according tothis invention, comprises the steps of parsing XMI file describing a UML class diagram in XML framework; storing metadata described in the XMI file into a platform-independent format; converting such metadata into Lisp representation; developing Lisp rules to detect design patterns; firing the said design pattern detection rules on the Lisp representation of UML class diagram; and identifying the design pattern.





This is a typical XMI representation, as actual representation varies in different versions of XMI. XMI file is parsed and acquired information (class names, attributes and operations, and the relations among classes) is stored in a temporary database repository, i.e. Internal Object Model (IOM). IOM is nothing but a set of classes used to store design information. The information is stored in form of objects and the hierarchy of objects is as shown in fig 2.
The IOM is then mapped into a Lisp representation, i.e. a Lisp list. The prototype of the Lisp representation is as follows:-
((class (modifier abstract/non-abstract static/non-static name) (attribute (modifier type static/non-static name)
(modifier type static/non-static name) )
(operation (modifier ab.stract/non-abstract/virtual
static/non-static
return-value name (parameter (type name) (type
name)...)
(delegation association-name function-name (parameter name 1 name2 ...)))-..) (super-class namel name2....) (association (association-name class-name)
(association-name class-name)...) (aggregation (aggregation-name class-name)
(aggregation-name class-name)...))....
Thus, in Lisp representation, aforementioned UML class diagram will look like:-
((class (public non-abstract non-static Car)
(attribute (private String non-static model)
(private String non-static make)) (operation (public non-abstract non-static void details
(parameter) (delegation)))

(super-class) (association) (aggregation)))
A set of Lisp rules are written to detect and infer design patterns from such a representation of class diagram from such representation of class diagram. An example of written rules, to detect singleton design pattern instances, is given below. The motivation behind choosing singleton design pattern to explain here is its simplicity.
The singleton pattern ensures that a class has only one instance. For inferring singleton design pattern, it is ensured that a class has all attributes with static classifier or no attributes at all. This con be given as;
1. classList = all classes in design
2. for each class in classList
3. for each attribute in class
4. if attribute is non-static
5. then remove olass from claas Liat
6. next attribute
7. next class
8. return classList
The Lisp representation of the above is given below.-
(defun singleton (design)
(let ((classes (get-class-names design))) (dolist (aclass design classes)
(dolist (anattr (get-attributes aclass) classes) (when (not (is-static-aftr anattr)) (setq classes (remove
(get-name aclass)
classes)))))))
(defun get-class-names (design)

(let ((classes nil))
(dolist (aclass design classes)
(push (get-name aclass) classes))))
(defun get-name (aclass)
(first (last (second aclass))))
(defun get-attributes (aclass) (rest (third aclass)))
(defun is-statio-attr (anattr)
(equal (third anattr) 'static))
Rules for other design patterns also coded in a similar way, based on their detection criteria. Once these rules are written and design is mapped into Lisp representation, we can easily infer design patterns by applying the rules over representation, like-
(singleton design)
After detecting design pattern instances we may need to redactor our original design to incorporate these design patterns. Different artifacts in such an improved design are easier to maintain, understand, reuse, and document.
Rules for detection of other design patterns such as proxy, adapter, builder etc. have been written. For example, the Rule for adapter

pattern will be: " Determine the candidate Classes to be in adapter pattern. These Classes should have at least one super Class and at least one of the operation to provide delegation to a non-sibling Class". These rules have been tested on large UML diagrams consisting of several Classes involving Inheritance and aggregation.
As shown in figure 3, UML class diagram in XMI file is taken as an input to the system. Given XMI file is parsed and stored in temporary storage, i.e. main memory. Storage representation in main memory is specified by Internal Object Model (IOM) that is a set of classes to store information about classes, their attributes and operations, as well as relations among classes. IOM is then converted to a Lisp list by Lisp converter module of the tool, Design pattern detection functions are taken from storage medium and applied over the design (in Lisp format). The results of design pattern detection functions are applicable design pattern instances. These results are passed to visual display unit for a display to the user.







We Claim:
1 .A method for enabling representation of UML Class diagram in a Lisp format and for design pattern detection in UML Class diagram comprising the steps of parsing XMI file describing a UML class diagram in XML framework, storing metadata described in the XMI file into a platform-independent format; converting such metadata into Lisp representation; developing Lisp rules to detect design patterns; firing the said design pattern detection rules on the Lisp representation of UML class diagram; and identifying the design pattern.
2. A method for enabling representation of UML Class
diagram in a Lisp format and for design pattern detection in
UML Class diagram substantially as herein described and
illustrated.
3. A system for enabling representation of UML class diagram
into a Lisp format and design pattern detection using such
representation comprising a storage media for the XMI file
(UML Class Diagram); a parser and analyzer for parsing the
sard XMI file; u temporaryt storage (main memory) for the
parsed XMI file as internal object model (IOM); a Lisp
Converter for converting the said IOM to a lisp List; a Lisp
Interpreter for receiving the design in lisp format from the
Lisp converter and also for receiving design pattern functions
from the storage media; and a visual display unit for displaying
the output of the Lisp Interpreter
4.A system for enabling representation of UML class diagram into u Lisp format and design pattern detection using such representation substantially as herein described and illustrated.


Documents:

2110-CHE-2006 CORRESPONDENCE PO.pdf

2110-CHE-2006 CORRESPONDENCE OTHERS 09-12-2010.pdf

2110-CHE-2006 EXAMINATION REPORT REPLY RECIEVED 11-12-2009.pdf

2110-CHE-2006 AMENDED PAGES OF SPECIFICATION 12-08-2010.pdf

2110-CHE-2006 CORRESPONDENCE OTHERS 12-08-2010.pdf

2110-che-2006-abstract.pdf

2110-che-2006-claims.pdf

2110-che-2006-correspondnece-others.pdf

2110-che-2006-description(complete).pdf

2110-che-2006-drawings.pdf

2110-che-2006-form 1.pdf

2110-che-2006-form 18.pdf

2110-che-2006-form 26.pdf


Patent Number 250303
Indian Patent Application Number 2110/CHE/2006
PG Journal Number 52/2011
Publication Date 30-Dec-2011
Grant Date 22-Dec-2011
Date of Filing 14-Nov-2006
Name of Patentee INDIAN INSTITUTE OF TECHNOLOGY
Applicant Address IIT P.O CHENNAI 600 036, INDIA
Inventors:
# Inventor's Name Inventor's Address
1 PROFESSOR DHARANIPRAGADA JANAKIRAM DEPARTMENT OF COMPUTER SCIENCE, IIT CHENNAI 600 036
2 MURUKESHKUMAR SHARMA DEPARTMENT OF COMPUTER SCIENCE, IIT CHENNAI 600 036
PCT International Classification Number G06F 3/00
PCT International Application Number N/A
PCT International Filing date
PCT Conventions:
# PCT Application Number Date of Convention Priority Country
1 NA