GENERATION OF UML CLASS DIAGRAM, DATABASE & WORKSPACE

Download class diagram included in the UML alone is contender for replacing entity ... make UML class diagram from it and it also creates a database...

0 downloads 515 Views 306KB Size
International Journal of Emerging Technology and Advanced Engineering Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 3, March 2012)

Generation of UML Class Diagram, Database & Workspace fro m EER D iagram Bhandare Milind1, Deshmukh Dipali2, Jagtap Rajnandini3,Kolhal Devyani4, Sanap Kanchan5 Computer Engineering Department, University of Pune 1

[email protected] 2 [email protected] 3 [email protected] 4 [email protected] 5

[email protected]

When user will complete the drawing of an EER diagram, he/she has to submit the EER diagram for further processing. On submitting the diagram, the data stored in the data structures will be written to XML files. This is an intermediate form of storage of data. This data will then be used by the system for both drawing the corresponding UML Class diagram as well as for generating database tables in Microsoft Access .mdb format. The UML Class diagram generated will be displayed to user and user will be given the facility to add additional features to the generated class diagram which cannot be specified through the EER diagram. After adding these features the class diagram will be updated and the database will also be updated according to these changes. Then we can generate corresponding code templates either in C++ or Java.

Abstract:-Unified Modeling Language is a standard for software development. Extended Entity Relationship Diagram (EERD) on the other hand is used for database design. The class diagram included in the UML alone is contender for replacing entity relationship models. UML was not explicitly created to support database design. This software provides an easy way to enter the specifications of a database and to make UML class diagram from it and it also creates a database from the given specifications. This software will accept input as EER Diagram. The diagram can save the given information. This information will save this information in XML file. By analyzing the saved information, the mapping from EERD to UML will be done and then the output viz. the corresponding UML class diagram will be generated. This software will also generate database tables in the form of MS Access files (.mdb).After that it will generate the code templates of corresponding diagram in C++ or Java. Keywords: UML, ERR diagram, Relationship, Database, Workspace.

Class

II. NEED OF THE SYSTEM UML is not simply a replacement for Entity Relationship Diagramming.It is a complete, integrated object-modeling environment with “n” parts. The class diagram included in the UML alone is contender for replacing entity relationship models. We no longer operate in a development environment where there will be many competing modeling standards. Despite its advantages over ER diagramming, UML is not without its weaknesses. In some ways, UML diagrams have more symbols making them more cluttered and therefore less easily understood by users. This may be due to the fact that UML was not explicitly created to support database design. However, class diagrams in UML are a superset of entity relationship modeling. There is nothing that can be expressed with ERD’s that cannot be expressed in UML notation; and there are many more structures and relationships possible to express in UML that are not possible with ERD notation.A major strength of UML is that it is explicitly extendable. This openness of UML architecture raises the specter of deviation from the standard. However, UML is rich enough that such deviation should be minimal and easily controlled.

diagram,

I. INTRODUCTION The given system accepts the input as EER diagram. There is a Graphical Editor provided which enables the user to draw an EER Diagram. This editor consists of some controls using which the user can enter the various components required in the EER Diagram. The Editor is provided with the facilities like draw components, add information about components, and delete components, and submit EER diagram. This editor will be also used to store information about each and every component of the EER diagram drawn in it. Special Data Structures are created to store the detailed information about each component of the EER diagram. Whenever user will draw a new component in editor, its information will be stored in the related data structure.

491

International Journal of Emerging Technology and Advanced Engineering Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 3, March 2012) UML is here to stay. One could argue that it is already the standard for all object-oriented development. UML can and should be used now for both logical and physical relational database modeling. The only reason not to make the shift now is that we do not currently have the products to support this shift. So in order to shift from conventional ER Diagram to the emerging UML Class Diagram, this system will be helpful to user to great extent, because it provides an easy way to convert a given ER Diagram to a basic UML class diagram. It also avoids the burden of user for creating database tables in Microsoft access format by readily generating them from the inputted ER Diagram.

C. CLASS DIAGRAM EDITOR In this editor the corresponding class diagram generated from the EER diagram is displayed. The user can see all the classes (Full view) generated from the EER diagram according to standard rules mentioned in book named “UML IN NUTSHELL”. To view the details (Detailed View) of a particular class user has to just double click on the corresponding class icon. Then user can change the properties of attributes of the class diagram like data type, multiplicity, null ability, default value. To come back to Full View user has to just double click on the current detailed class.In detailed view user can associate the classes with different notes, stereotypes, tagged values, constraints by clicking on particular button. The changes made by user in class diagram can be mapped to database by clicking on button map to d/b. This is where we are synchronizing both the Class diagram and EER Diagram specification for creating database. This is special point of s/w. First it creates the rough database (.mdb) using EER the user can make more particular, specificdatabase by specifying the constraints through the class diagram which are then mapped to database. All the error checking is done in the s/w itself while drawing the EER ,so it does not allow user to draw wrong/incorrect EER Diagram thus there is no further chances of getting error.

III. RELEVANCE OF WORK Basically our software contains 3 basic editors, there are as follows:1.Extended Entity relationship diagram editor(EER). 2.Database Editor 3.UML class diagram editor. 4.Workspace A. EER EDITOR This component of software is used by user for drawing the EER diagram.In this the user is provided with a toolbar which has following 3 types of buttons. i) Buttons for drawing the EER diagram components : One button each for Entity, relationship, strong entity, weak entity, derived attribute, multivalve attribute, primary key, ISA relationship, connecting the drawn components of EER Diagram. [7] ii) Buttons for managing/editing the EER diagram components :One button each for moving, deleting, renaming, changing color of component border, changing color of component name font, of drawn EER Diagram components. iii) Buttons for generating the corresponding database(.mdb file i.e. Microsoft Access file) and corresponding class diagram : One button each for generating the corresponding database (.mdb file i.e. Microsoft Access file) and corresponding class diagram. For drawing components the user has to click on the button and then click on drawing area (paint box) on the form where user wants to put. After clicking on the drawing area user needs to enter name for component.

D. WORKSPACE This consist the code templates in C++ and Java. It displays the corresponding code of the input EER diagram. In this, there is separate file created in which the corresponding templates can be saved.

IV. IMPLEMENTATION OF CLASS DIAGRAM In given below diagram we can various similar terminologies between EER and UML. We are going to this terminologies for various conversions between EER to UML.

B. DATABASE EDITOR This editor contains buttons for insuring, deleting, and updating entries into the database. In this editor we show the various tables generated by our software (in .mdb file) in the form of Icon Buttons. When user moves mouse cursor on the table button the s/w displays the Primary key of the table, its type (Relationship or entity), its base type (Strong / weak)on the left side of the form. When the user clicks on the button the contents of table are displayed.In this mode user can update database. [3]

Fig(i) EER Vs UML Terminology

492

International Journal of Emerging Technology and Advanced Engineering Website: www.ijetae.com (ISSN 2250-2459, Volume 2, Issue 3, March 2012) The following fig(ii) shows the simple example of conversion of EER diagram into class diagram.

V. ADVANTAGES 1.This software synchronizes the relational and Object Oriented Approaches to database design which results in efficient database design and also helps the application developer to get an accurate idea of application to be developed. 2. Since this software performs subset to superset mapping there is no chance of information loss. 3. It saves project into text file instead of bitmap or jpg which saves space. 4. User friendly GUI helps to develop EER Diagrams easily. 5. User doesn’t need to fire complex queries for adding constraints to database, by simply changing properties in class diagram s/w reflects them into database. 6. Software generates code templates for classes in JAVA and C++ .So user can directly start writin the code for functions. 7. It saves and reopens the previously created database and class diagram along with the EER Diagram. User can also save the EER Diagram and Class diagram in bitmap files so he/she can take printout of it.

Fig(ii)EER to class conversion

VI. CONCLUSION

In the fig.4.2 Employee is an entity which has two attributes i.e. NAME and E#. We assign E# as primary key. Employee is get converted into class name and attributes of the Employee get converted as attributes of class. NAME has two compsite attributes that get converted into structured domain of class diagram. The full conversion of EER diagram into class diagram is shown in fig(iii)

In this system we will provide three editors. Its necessary tools regarding each of editors are provided in it. In EER editor since the diagram has conversion for drawing error checking was necessary. This error checking is done at the time of insertion of the components on the screen. Thus there is no need of external error checking while submitting the diagram. For Database editor error checking is done against invalid records entries. The modification in class diagram will help to enhance the models of database to be done more particularly, efficiently. Thus database generated through this software will be very much closer to user requirement. References [1] James Rumbaugh, Ivar Jacobson, Grady Booch,” The Unified Modeling Language Reference Manual”, ISBN 0-20130998-X [2] Srinivasan Desinik, Gopalswamy Ramesh, “Test Planning “, Software testing Principles and Practices”, 352-361 [3] Henry F. Korth, “Database SystemConcepts”. [4] Dan Pilone, Neil Pitman “UML 2.0 in a Nutshell”,(In a Nutshell(O'Reilly)) Paperback). [5] http://findarticles.com [6] www.altova.com/databasespy/ediagrams.html [7] www.databasedesigning.com/ER1.html

Fig(iii) EER Vs UML Class Complete Diagram

493