Do You Know Class Diagram ??
The class diagram is a static diagram. It represents the static view of an application. Class diagram is not only used for visualizing, describing and documenting different aspects of a system but also for constructing executable code of the software application.
The class diagram describes the attributes and operations of a class and also the constraints imposed on the system. The class diagrams are widely used in the modelling of object oriented systems because they are the only UML diagrams which can be mapped directly with object oriented languages.The class diagram shows a collection of classes, interfaces, associations, collaborations and constraints. It is also known as a structural diagram.
Purpose . . .
The purpose of the class diagram is to model the static view of an application. The class diagrams are the only diagrams which can be directly mapped with object oriented languages and thus widely used at the time of construction.
The UML diagrams like activity diagram, sequence diagram can only give the sequence flow of the application but class diagram is a bit different. So it is the most popular UML diagram in the coder community.
So the purpose of the class diagram can be summarized as:
· Analysis and design of the static view of an application.
· Describe responsibilities of a system.
· Base for component and deployment diagrams.
· Forward and reverse engineering.
The class diagram is a static diagram. It represents the static view of an application. Class diagram is not only used for visualizing, describing and documenting different aspects of a system but also for constructing executable code of the software application.
The class diagram describes the attributes and operations of a class and also the constraints imposed on the system. The class diagrams are widely used in the modelling of object oriented systems because they are the only UML diagrams which can be mapped directly with object oriented languages.The class diagram shows a collection of classes, interfaces, associations, collaborations and constraints. It is also known as a structural diagram.
Purpose . . .
The purpose of the class diagram is to model the static view of an application. The class diagrams are the only diagrams which can be directly mapped with object oriented languages and thus widely used at the time of construction.
The UML diagrams like activity diagram, sequence diagram can only give the sequence flow of the application but class diagram is a bit different. So it is the most popular UML diagram in the coder community.
So the purpose of the class diagram can be summarized as:
· Analysis and design of the static view of an application.
· Describe responsibilities of a system.
· Base for component and deployment diagrams.
· Forward and reverse engineering.
How to draw Class Diagram?
Class diagrams are the most
popular UML diagrams used for construction of software applications. So it is
very important to learn the drawing procedure of class diagram. Class diagrams
have lot of properties to consider while drawing but here the diagram will be
considered from a top level view.
Class diagram is basically a
graphical representation of the static view of the system and represents
different aspects of the application. So a collection of class diagrams
represent the whole system.
The following points should be
remembered while drawing a class diagram:
- The
name of the class diagram should be meaningful to describe the aspect of
the system.
- Each
element and their relationships should be identified in advance.
- Responsibility
(attributes and methods) of each class should be clearly identified.
- For
each class minimum number of properties should be specified. Because
unnecessary properties will make the diagram complicated.
- Use
notes when ever required to describe some aspect of the diagram. Because
at the end of the drawing it should be understandable to the
developer/coder.
- Finally,
before making the final version, the diagram should be drawn on plain
paper and rework as many times as possible to make it correct.
In the class diagram, there are
several elements, including:
- Class : class filled by a
set of activities that had previously been in use case diagram that had previously
been made.
- Attributes (-) : A
typed value attached to each instance of a classifier. To add an attribute,
click the Attributes section and then press ENTER. Type the signature of the
attribute.
- Operations (+ ) : A
method or function that can be performed by instances of a classifier. To add
an operation, click the Operations section and then press ENTER.
- Association : A relationship between the members of two
classifiers.
Now the
following diagram is an example of a Class Diagram Blog. So from the above
picture explains:
In the class diagram of this blog consists of 12 classes, that is:
Main, Manage profile, Manage post, manage comment, Manage tamplate, Manage
layout, table layout, table tempalate, user table, table post, comment table,
database connection.
Clarification :
1. In the main
class consists of 8 operations consisting of: menu, manage profile, manage
posts, manage tamplate, manage comments, manage layouts, manage apply for google
adsense, login.
2. In manage
class layout consists of three operations, that is: delete layout, edit layout,
and add layouts.
3. In class
manage profile consists of 5 operations, that is: set new profile, edit a
profile, select profile, view profiles, set change photos.
4. In class manage comment consists of 4 operations, that is: replay
comment, view comments, delete comments, input comment.
5. In the post
consists of the manage class 3 operations, that is: edit posts, delete posts,
create new post. Where class is related to class manage manage comment.
6. In manage
tamplate class consists of two operations, that is: tamplate edit and change
tampalate.
7. In class
table layout consists of 3 attributes and 6 operations, including:
· Attributes: blog post
layout, layout attributes, and popular posts.
· Operations: set and get the
blog post layout, set and get attribute layout, and set and get popular posts.
8. In the user
table class consists of 3 attributes and 4 operations , including :
·
Attributes : profile id ,
user name , and email .
·
Operations : set and get id
profile and set and get the user name .
9. Comment in
the class table consists of 4 attributes and 4 operations , including :
·
Attributes : browse comment
, comment date , email , and the recipient .
·
Operations : set and get
the contents of comment , as well as set and get th comment .
10. In the post-
class table consists of 4 attributes and 6 operations , including :
·
Attributes : post title , post date , post content , posted .
·
Operations : set and get the post title , post date set and get ,
set and get the post content .
11. In the table
tamplate class consists of 4 attributes and 8 operations , including :
·
Attributes : type tamplate
, layout tamplate , tamplate color , font tamplate .
· Operations : set and get
kind of tamplate , set and get tamplate layout , set and get the color tamplate , set and get tamplate , as
well as set and get the font tamplate .
12. In the database connection consists of 4
attributes and 4 operations , including :
·
Attributes : user , database , username , password .
·
Operations : open connection , open a select query , update query
select, close the query .
many
explanations of the class diagram blog that I have made and I explained,
hopefully useful for all of you who has reading it ..
Thank
you .. see youuuu all..
source :
http://www.tutorialspoint.com/uml/uml_class_diagram.htm
http://msdn.microsoft.com/en-us/library/vstudio/dd409437.aspx
source :
http://www.tutorialspoint.com/uml/uml_class_diagram.htm
http://msdn.microsoft.com/en-us/library/vstudio/dd409437.aspx