Monday, October 28, 2013

Class Diagram Blog

Class Definition Diagram

Class diagrams are used to show classes and packages in the system . Class diagram gives an overview of the system and the static relationships between them . Typically , dibua some class diagrams for a single system . Some diagrams will show a subset of the classes and their relationships . Can be made ​​a few diagrams as desired to get a complete picture of the system is built .
Class diagram is the best tool for the design of the development team . The diagram helps developers get the system structure before the code is written , and help to ensure that the system is the best design .
- Class
Class is something that wraps and behavioral information . Traditionally , the system is built with the basic idea that will save the information on the data lines and pengolahnya behavioral data on the application side . One of the differences structured object-oriented approach is
in combining object-oriented and information -processing behavior and hide all the information into something called class . In UML , classes are expressed using the following notation .
   
The top of the Class notation is used as a class name , and optionally also used his stereotype . The middle section is used to store attributes , and the bottom is used to save the operation .
- Define the class
A good way to find classes were started from watching the flow of events ( flow of events ) of a use case . Note the noun in the flow of events , may be one of the following four points .
1 . Actor
2 . class
3 . Attributes of the class
4 . Expression , not the actor , not a class , and not attributes .
By selecting the object in the flow of events , classes can be found in the system . Other alternatives , can test objects in sequence diagrams and collaboration diagrams .
There are two common ways of defining sequence of inter -related classes in the class diagram and sequence diagrams or collaboration diagram.Yang first , by creating a sequence diagram or a collaboration diagram first . Then proceeded to create the class diagram . In contrast , the second , is to find classes and create class diagrams first, then use a stretcher classes as " Dictionary " objects and their relationships to create a sequence diagram or a collaboration diagram .
- Stereotype in class
Stereotype is a mechanism used to categorize classes . For example , can be made stereotypical form first , and then determine the classes in step further . This feature helps to better understand the responsibilities of each class in the model . The classes with the stereotype of ' form ' responsibility to show and receive information from the user .
Stereotypes also assist in the process of code generation . When the code generation process , stereotype class that will determine the type of class diabawa kebahasa programming .
Some Stereotypes can be used since at this stage of the analysis process , at the time not yet determined teretentu programming language to generate code . Stereotypes can also depend on the programming language chosen and used at this stage of the design process .
When analysis , classes can be categorized according to the function they perform . There are 3 types of classes in the UML stereotypes are used in the analysis , namely : delimiter ( boundry ) , entity ( entity ) and control .
a. Limiting classes
Limiting classes are classes that are located between the system with the world around him . All forms , reports , interfaces ( interfaces ) such as soft keperangkat Printer or scanner , and interfaces ( interfaces ) to other systems are included in this category . UML presented
class barrier as follows .


To locate and identify the limiting classes can be done by testing the use case diagram . At a minimum there should be a barrier to class setiapa interaction between actors - use case . Class limit is what allows the actors interact with the system .
No need to make the grade boundary for each pair of actor - use case . For example , if two actors have equally initialize the same use case to communicate with the system .

b . Entity classes
Entity classes to handle the information stored in persistent storage . Entity classes are usually found in the incident flow ( flow of events ) on the interaction diagram . They are classes that are most meaningful to the wearer and are typically given a domain name using the technology business.

       Note the noun in the flow of events . Some nouns will be the entity classes in the system . Another way is to consider the structure of the data base . If the design of the database has been created , note the names of the table . The tables deal with some permanent information record , while the entity class , handle information in computer memory when the computer is turned on . In UML , the class notation entity described as follows .


Of database design , can trace back some of the fields in the database system needs . System needs to determine the flow of events ( flow of events ) , and the flow of events to determine the objects , classes , and attributes - attributes in the class . Each of these attributes in the entity class may be fields in the database .
c . Control classes
Control class is responsible for coordinating the activities of the other classes . This class is optional , but if the class of this control is used , then tropical one control class for such a use case . There are classes that control is shared by several use cases . In UML , the class notation entity described as follows .


 naming class
Each class must have a unique name . Most organizations have their own naming convention for naming classes are made ​​. Classes are generally named using singular noun .
Do not use the class name spaces . This is done for practical reasons , where some programming languages ​​do not allow any space . Another thing to note is that the class name should be short enough to explain what the class will do .
So it really depends on the class naming our organization . If we have a class that is used within the organization , but it is clear that it should be consistently used for whole classes were made ​​.
- Visibility class
Visibility option determines whether a class can be seen from the outside of the package . There are 3 options for the visibility of a class is:
1 . Public
2 . States that a class can be seen from the other classes in the system .
3 . Protected or private
4 . States that a class can be seen from multiple classes ( nested ) , friends , or of the class itself .
5 . Package or implementation .
6 . States that a class can be seen only by other classes in the same package .
multiplicity class
Multiplicity provide instant overview ebuah to be accommodated in the classroom . For example , in a class of employees , we may have some instant , one for Ani , one for Ina , one for Nana and so on . So Multiplicity for n set class employees . In the control class , Multiplicity is set 1 , because at the time the application runs only one class .
Several types of Multiplicity class .
Table Multiplicity for class :

Multiplicity
Arti
n (default)
Banyak
0..0
Nol
0..1
Nol atau Satu
0..n
Nol atau Banyak
1..1
Tepat satu
1. .n
Satu atau banyak


Multiplicity Notation table using the customization

Format
Arti
Tepat
..
Antara
..
Atau nol
,
, ..
Tepat atau antara dan
.. ,
..
Antara dan atau antara dan
package 
Package used unruk group classes have in common . In UML , described as follows :


There are several ways to group classes in the package , but somehow , these classes can be grouped in the same package depends on our own desires . One approach that can be used is based on the stereotype . With this approach , a package can be created for entity classes , and one class for the control classes .
Other approaches that can be used is with functionality. For example , we have a security package for the classes that are used to handle the security system .

Finally , it can be used a combination of the above two approaches . Package can be nested , in which a packet containing other packages . At the highest level , can be grouped based on functionality , then followed with another sub functionality or with his stereotype .

No comments:

Post a Comment