Você está na página 1de 4

UML 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.

Now the following diagram is an example of an Order System of an application. So it describes a particular aspect of the entire application. First of all Order and Customer are identified as the two elements of the system and they have a one to many relationship because a customer can have multiple orders. We would keep Order class is an abstract class and it has two concrete classes (inheritance relationship) SpecialOrder and NormalOrder. The two inherited classes have all the properties as the Order class. In addition they have additional functions like dispatch () and receive ().

So the following class diagram has been drawn considering all the points mentioned above:

Where to use Class Diagrams? Class diagram is a static diagram and it is used to model static view of a system. The static view describes the vocabulary of the system. Class diagram is also considered as the foundation for component and deployment diagrams. Class diagrams are not only used to visualize the static view of the system but they are also used to construct the executable code for forward and reverse engineering of any system. Generally UML diagrams are not directly mapped with any object oriented programming languages but the class diagram is an exception. Class diagram clearly shows the mapping with object oriented languages like Java, C++ etc. So from practical experience class diagram is generally used for construction purpose. So in a brief, class diagrams are used for: Describing the static view of the system. Showing the collaboration among the elements of the static view. Describing the functionalities performed by the system. Construction of software applications using object oriented languages.

Abstract Data Type In computer science, an abstract data type (ADT) is a mathematical model for a certain class of data structures that have similar behavior; or for certain data types of one or more programming languages that have similar semantics. An abstract data type is defined indirectly, only by the operations that may be performed on it and by mathematical constraints on the effects (and possibly cost) of those operations.[1] For example, an abstract stack data structure could be defined by three operations: push, that inserts some data item onto the structure, pop, that extracts an item from it (with the constraint that each pop always returns the most recently pushed

item that has not been popped yet), and peek, that allows data on top of the structure to be examined without removal. When analyzing the efficiency of algorithms that use stacks, one may also specify that all operations take the same time no matter how many items have been pushed into the stack, and that the stack uses a constant amount of storage for each element. Abstract data types are purely theoretical entities, used (among other things) to simplify the description of abstract algorithms, to classify and evaluate data structures, and to formally describe the type systems of programming languages. However, an ADT may be implemented by specific data types or data structures, in many ways and in many programming languages; or described in a formal specification language. ADTs are often implemented as modules: the module's interface declares procedures that correspond to the ADT operations, sometimes with comments that describe the constraints. This information hiding strategy allows the implementation of the module to be changed without disturbing the client programs. The term abstract data type can also be regarded as a generalised approach of a number of algebraic structures, such as lattices, groups, and rings.[2] This can be treated as part of subject area of Artificial intelligence. The notion of abstract data types is related to the concept of data abstraction, important in object-oriented programming and design by contract methodologies for software development[citation needed].

Standard Classes Object An arbitrary Scheme value - and hence an arbitrary Java object. Number The type of Scheme numbers. Quantity The type of quantities optionally with units. This is a sub-type of number. Complex The type of complex numbers. This is a sub-type of quantity. Real The type of real numbers. This is a sub-type of complex. Rational The type of exact rationl numbers. This is a sub-type of real. Integer The type of exact Scheme integers. This is a sub-type of rational. Symbol The type of Scheme symbols. (Implemented using the Java class gnu.mapping.Symbol.) (Compatibility note: Previous versions of Kawa implemented a simple Scheme symbol using an interned java.lang.String.) Keyword The type of keyword values. See Keywords. List The type of Scheme lists (pure and impure, including the empty list). Pair The type of Scheme pairs. This is a sub-type of list. String The type of Scheme strings. (Implemented using java.lang.String for immutable strings, and gnu.lists.FString for mutable strings. Both of these implement the interface java.lang.CharSequence. In the future, we may change the representation for strings containing surrogate characters, for efficient indexing.) (Compatibility note: Previous versions of Kawa implemented always used gnu.lists.FString.)

Character The type of Scheme character values. This is a sub-type of Object, in contrast to type char, which is the primitive Java char type. Vector The type of Scheme vectors. Procedure The type of Scheme procedures. input-port The type of Scheme input ports. output-port The type of Scheme output ports. String This type name is a special case. It specifies the class java.lang.String. However, coercing a value to String is done by invoking thetoString method on the value to be coerced. Thus it "works" for all objects. It also works for #!null. When Scheme code invokes a Java methods any parameter whose type is java.lang.String is converted as if it was declared as a String.

Você também pode gostar