Génie logiciel

 Diagram ya Kelasi

Ko discover ba objects ya system na decomposition

Decomposition ya ba messages emonisaka ba objects ya system, .

mpo ememaka na bansango ya malamu koleka oyo esengeli kolukama

moto oyo azali koyamba yango. Lolenge mosusu oyo ekoki kosalema ezali bongo kopɔla ya bansango

oyo ezali na kati ya eloko moko. Mbala mingi, nsango yango ezalaka mindɔndɔ mingi mpo na komonisama bobele na ndenge oyo eloko moko esalemi. Esengeli asala bongo

ntango mosusu ekabolama ndenge moko kati na biloko mingi.

Example: Editing a horse to fit various organs that can be done in a sequence edit, such as in an edit guide with data. The decomposition of the sequence diagram consists of an analyzer of differences when receiving a message: fresh, courier, eat, sleep.

These are some of the different organs that are going on you horse. Shown in Figure 6.1 to send a message please. A horse dilates its nostrils blow mark alert, surprise or fear. The bottle is used to relieve tension, cold or chill. Finally, The path is a defensible movement.


Figure 6.1 Découverte des objets par enrichissement du diagramme de séquence

Data-driven decomposition requires learning simultaneously various organs of the horse and for examination listed on the class diagram. Figure 6.2 shows a horse composed of its various members.


                                                  Figure 6.2 Horse structure

Decomposition and sequence diagram, as well data-driven decomposition seems natural for take these things. This result is normal because an object exists assembly of a structure and behavior. Ultimately, it’s worth it to recognize that the two approaches are incompatible. Data-driven decomposition is more efficient when the person responsible for modeling knows the domain well.

Class representation

 Simple form of class representation System objects are defined by classes, similarly a simple illustration in UML is given in Figure 6.3. This finding is based on three parts.



                                          Figure 6.3 Simple representation of a class in UML

The first part contains the class name.

The second part is characteristic. That's in the

the effects of an object. All shape attributes

the structure of the object.

The third part is intellectual. This is equivalent to.

services provided by the object. They can change the value of attributes.

A set of methods determines the behavior of the object.

Example:

                                                            Figure 6.4 Vehicle Class

This type of class representation is simplistic because it is not
does not exhibit character traits and experience with
out of their name. Very often used in the first tense
the modeling phase. Before looking at more complete representations, we need to address
essential notions of encapsulation, type and signature of methods.

 Internalization

Encapsulation is introduced in the Approach concepts chapter through the materials. Other attributes and methods are not exposed outside of the object. Encapsulated are also called private attributes in object methods. UML, like most modern object-oriented languages, introduces three encapsulation possibilities:
Private attribute or method: property is not exposed outside of the class, even within its smaller classes. 
Protected attribute or method: property is still exposed to instances of the class and its subclasses.
Packet encapsulation: the property is only exposed to instances classes of a set.
The concept of private goods is rarely used because it carries to distinguish between instances of a class and of instances of its subclasses. In terms of encapsulation of package, from the Java language. It is reserved for writing diagrams for developers. 
Encapsulation is indicated by a plus sign, a minus sign, a weight, or a tilde preceding the attribute name. The following table discusses the meaning of these symbols in more detail.


Example
Figure 6.5 shows the Vehicle class showing the characteristics
its encapsulation.
Figure 6.5 Vehicle class and encapsulation characteristics

Notion of type We call a variable here any attribute, parameter and value of returning from a method. Generally, we call variable any element that can take a value.
The type is the constraint applied to the variable. It consists of fixing the set of possible values that this
variable. This set can be a class, in this case a variable there must be a reference to an instance of this class. can being standardized as a set of integers, strings of symbols, booleans or reals. In these latter cases, the the value of the variable must be respectively an integer, a character string, boolean and real values. Typical patterns are given as follows:
● Integer for integer type.
● String for character string type.
● Boolean for type of Booleans.
● True for the type of reals.
The attribute type, parameter and return value of the method are specified at the class representation level.
Example   :Figure 6.6 shows the Car class in which the type of all attributes has been changed.
Figure 6.6 The Car class with attribute types

Signature of Methods 

A class method can take parameters and return the resulting results. Parameters are transmitted values:

● in outbound traffic, when sending a message invoking the method.
● or when the method call returns. The result is the value passed to the object calling the return time
call. As we saw earlier, these parameters as well as the the result can be type. This set is named method, .
parameters with their name and type as well as the result type it is called a method signature. A signature is found on the form
next :
<Type name> (<Parameter name>:<type>,...):<Result type>
Remember that the number of parameters can be set to zero and that the type of the result is optional.
Example: 
 Figure 6.7 shows a Vehicle class whose driving method has been equipped of two parameters, both of these values belong to Location types. As for the other methods, they take no parameters and are not available do not return results. 
Figure 6.7 Vehicle class and method signatures

5. Full Type of Class Representation 

Full representation of classes specifies attributes with their encapsulation characteristic, their type and their methods full signature. It is also possible to assign default values to attributes as well in the parameters of a method. The default value of the attribute is assigned when creating a new product. There .the default value of the parameter is used when the caller of a method does not explicitly quantify this parameter during the call. Figure 6.8 shows a complete representation of a class. Is indeed possible to choose an intermediate representation between the simple analysis and comprehensive representation.


                      Figure 6.8 Représentation complète d'une classe en UML

This complete representation is of particular interest to the developer responsible for creating modeling downstream software. He thus has a class definition that is very close to what he needs to use in his programming language.

Class Attributes and Methods

Each instance of a class has a specific value for each of its characteristics. Thus, this value is not divided by all the instances. In some cases, attributes whose value is one on all objects must be used of the same class. Such an attribute sees its value evenly distributed such as its name, type, and default value. Such an attribute exists it is called a class attribute because it is related to the class. The class attribute is indicated by the underlined name. He may be encapsulated and available in type. It is highly recommended that he provide the default value.

Example:

Figure 6.9 shows a class describing a spare part of a vehicle. When the product sold is subject to VAT the value is the same for all parts. This attribute is highlighted and protected because it is used to calculate the price on Taxes are included. It is expressed as a percentage so its type Integer.

The default value is 30 goods VAT rate this is not food.

Figure 6.9 Class characteristic
This method is used for the priceWithoutVAT attribute and the result of Method priceAnd VAT is Money. It shows that the values are amounts of money.
Within a class, there can also be one or more class methods. These have to do with education. To call
method of the class, you need to send a message to the class itself and not to one of its instances. Such a method does not it only manipulates class attributes.
Example :
 Figure 6.10 adds a class method to a class Piece used to fix the rate of VAT.
In fact, this is regulated and the latter may be is arranged.
Figure 6.10 Type of class
The attribute or method of the class is not inherited. In Indeed, inheritance depends on the meaning of instances computed by the union of the structure and behavior of class and its upgrades. A subclass can access a attribute or in the class method of one of its superclasses but you shall not inherit it. Recall also that a subclass can access to a class attribute or method of one of its overclasses, if private encapsulation is not used.

 These attributes will in the calculation

    UML inserts in the calculated attribute what its value is matching this function to the value of the attributes. Such an attribute is named the is the first of the sign / and this of this constraint means of calculating its value.
Example:
We return to is of Figure 6.10. and therefore method
priceWithVAT instead of which attribute lists /priceWith VAT
variety in Figure 6.11.


                                                  Figure 6.11 Calculated attribute
Any constraints identified in the UML diagram are recorded between the braces.










Post a Comment

Previous Post Next Post

نموذج الاتصال